diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index 8b28e8a5aa3..128e7f5e9d6 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -1492,7 +1492,7 @@ void SymbolDatabase::createSymbolDatabaseIncompleteVars() continue; if (Token::Match(tok->next(), "::|.|(|{|:|%var%")) continue; - if (Token::Match(tok->next(), "&|&&|* )|,|%var%")) + if (Token::Match(tok->next(), "&|&&|* )|,|%var%|const")) continue; // Very likely a typelist if (Token::Match(tok->tokAt(-2), "%type% ,") || Token::Match(tok->next(), ", %type%")) diff --git a/test/testsymboldatabase.cpp b/test/testsymboldatabase.cpp index 67b5edf064d..e7d2e45e2ce 100644 --- a/test/testsymboldatabase.cpp +++ b/test/testsymboldatabase.cpp @@ -5483,12 +5483,15 @@ class TestSymbolDatabase : public TestFixture { GET_SYMBOL_DB("void f(QObject* p, const char* s) {\n" " QWidget* w = dynamic_cast(p);\n" " g(static_cast(s));\n" + " const std::uint64_t* const data = nullptr;\n" "}\n"); ASSERT(db && errout.str().empty()); const Token* qw = Token::findsimplematch(tokenizer.tokens(), "QWidget * >"); ASSERT(qw && !qw->isIncompleteVar()); const Token* s = Token::findsimplematch(qw, "string >"); ASSERT(s && !s->isIncompleteVar()); + const Token* u = Token::findsimplematch(s, "uint64_t"); + ASSERT(u && !u->isIncompleteVar()); } }