* Fix #10174 debug: Executable scope 'x' with unknown function * Format * Add test for #10198 * Fix #10260 debug: Executable scope 'x' with unknown function.
This commit is contained in:
parent
3ba6914563
commit
c4dcfef385
|
@ -2130,7 +2130,7 @@ namespace {
|
||||||
const ScopeInfo3 *scopeInfo = memberClassScope ? memberClassScope : currentScope;
|
const ScopeInfo3 *scopeInfo = memberClassScope ? memberClassScope : currentScope;
|
||||||
|
|
||||||
// check in base types
|
// check in base types
|
||||||
if (scopeInfo->findTypeInBase(scope))
|
if (qualification.empty() && scopeInfo->findTypeInBase(scope))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// check using namespace
|
// check using namespace
|
||||||
|
|
|
@ -4919,6 +4919,29 @@ private:
|
||||||
ASSERT(function && function->token->str() == "A");
|
ASSERT(function && function->token->str() == "A");
|
||||||
ASSERT(function->hasBody());
|
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() {
|
void createSymbolDatabaseFindAllScopes1() {
|
||||||
|
|
Loading…
Reference in New Issue