From 2cf4b3a6f35b20eb5496423e976bbb40b96be070 Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Mon, 24 Jul 2023 16:26:23 +0200 Subject: [PATCH] Fix functionConst TODO (#5261) --- 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 41d99055f..14e7ece42 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 53371d545..f79744666 100644 --- a/test/testclass.cpp +++ b/test/testclass.cpp @@ -6061,7 +6061,7 @@ private: " 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"