diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index 22f54c121..b61b4c02b 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -4952,7 +4952,7 @@ void SymbolDatabase::setValueType(Token *tok, const ValueType &valuetype) } if (vt1 && vt1->smartPointerType && Token::Match(parent, ". %name% (") && parent->originalName() == "->" && !parent->next()->function()) { - const Scope *scope = valuetype.smartPointerType->classScope; + const Scope *scope = vt1->smartPointerType->classScope; const Function *f = scope ? scope->findFunction(parent->next(), false) : nullptr; if (f) parent->next()->function(f);