From 3bae681a54fc6d33f6cb00c651a74aa2fe1c464c Mon Sep 17 00:00:00 2001 From: chrchr Date: Mon, 24 Jul 2023 12:10:50 +0200 Subject: [PATCH] Fix functionConst TODO --- lib/symboldatabase.cpp | 2 +- test/testclass.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index 41d99055f45..14e7ece42ad 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -1107,7 +1107,7 @@ void SymbolDatabase::createSymbolDatabaseSetFunctionPointers(bool firstPass) continue; bool isTemplateArg = false; - if (tok->next()->str() != "(") { + if (!Token::Match(tok->next(), "(|{")) { const Token *start = tok; while (Token::Match(start->tokAt(-2), "%name% ::")) start = start->tokAt(-2); diff --git a/test/testclass.cpp b/test/testclass.cpp index 53371d545c3..f79744666c7 100644 --- a/test/testclass.cpp +++ b/test/testclass.cpp @@ -6061,7 +6061,7 @@ class TestClass : public TestFixture { " int i{};\n" " S f() { return S{ &i }; }\n" "};\n"); - TODO_ASSERT_EQUALS("[test.cpp:7]: (style, inconclusive) Technically the member function 'C::f' can be const.\n", "", errout.str()); + ASSERT_EQUALS("[test.cpp:7]: (style, inconclusive) Technically the member function 'C::f' can be const.\n", errout.str()); checkConst("struct S {\n" " explicit S(const int* p) : mp(p) {}\n"