This commit is contained in:
parent
2b61c9ef2f
commit
8b6cbe2e9e
|
@ -3286,7 +3286,7 @@ void SymbolDatabase::addClassFunction(Scope **scope, const Token **tok, const To
|
|||
tok1 = tok1->tokAt(2);
|
||||
scope2 = scope2->findRecordInNestedList(tok1->str());
|
||||
}
|
||||
if (isAnonymousNamespace)
|
||||
if (scope2 && isAnonymousNamespace)
|
||||
scope2 = scope2->findRecordInNestedList(tok1->str());
|
||||
|
||||
if (count == 1 && scope2) {
|
||||
|
|
|
@ -5463,6 +5463,7 @@ private:
|
|||
}
|
||||
|
||||
void createSymbolDatabaseFindAllScopes7()
|
||||
{
|
||||
{
|
||||
GET_SYMBOL_DB("namespace {\n"
|
||||
" struct S {\n"
|
||||
|
@ -5486,6 +5487,25 @@ private:
|
|||
ASSERT_EQUALS(f->function()->functionScope->functionOf, &*S);
|
||||
ASSERT_EQUALS(f->function()->functionScope->bodyStart->linenr(), 6);
|
||||
}
|
||||
{
|
||||
GET_SYMBOL_DB("namespace {\n"
|
||||
" int i = 0;\n"
|
||||
"}\n"
|
||||
"namespace N {\n"
|
||||
" namespace {\n"
|
||||
" template<typename T>\n"
|
||||
" struct S {\n"
|
||||
" void f();\n"
|
||||
" };\n"
|
||||
" template<typename T>\n"
|
||||
" void S<T>::f() {}\n"
|
||||
" }\n"
|
||||
" S<int> g() { return {}; }\n"
|
||||
"}\n");
|
||||
ASSERT(db); // don't crash
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
}
|
||||
|
||||
void createSymbolDatabaseIncompleteVars()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue