diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 8d3c053b5..199fbb993 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -2130,7 +2130,7 @@ namespace { const ScopeInfo3 *scopeInfo = memberClassScope ? memberClassScope : currentScope; // check in base types - if (scopeInfo->findTypeInBase(scope)) + if (qualification.empty() && scopeInfo->findTypeInBase(scope)) return true; // check using namespace diff --git a/test/testsymboldatabase.cpp b/test/testsymboldatabase.cpp index 069580ec2..163788a35 100644 --- a/test/testsymboldatabase.cpp +++ b/test/testsymboldatabase.cpp @@ -4919,6 +4919,29 @@ private: ASSERT(function && function->token->str() == "A"); ASSERT(function->hasBody()); } + { + GET_SYMBOL_DB("namespace N {\n" // #10260 + " namespace O {\n" + " struct B;\n" + " }\n" + "}\n" + "struct I {\n" + " using B = N::O::B;\n" + "};\n" + "struct A : I {\n" + " void f(B*);\n" + "};\n" + "void A::f(N::O::B*) {}\n"); + ASSERT(db); + ASSERT_EQUALS(1, db->functionScopes.size()); + auto it = std::find_if(db->scopeList.begin(), db->scopeList.end(), [](const Scope& s) { + return s.className == "A"; + }); + ASSERT(it != db->scopeList.end()); + const Function* function = findFunctionByName("f", &*it); + ASSERT(function && function->token->str() == "f"); + ASSERT(function->hasBody()); + } } void createSymbolDatabaseFindAllScopes1() {