From 18c95bf0a4a31642bab4ba84ccaa34a0da95c543 Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Tue, 25 Nov 2025 13:46:32 +0100 Subject: [PATCH 1/4] Update symboldatabase.cpp --- lib/symboldatabase.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index 5bb96a8cd4d..4315ccf4406 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -1521,6 +1521,8 @@ void SymbolDatabase::createSymbolDatabaseIncompleteVars() continue; if (Token::Match(tok->next(), "&|&&|* *| *| )|,|%var%|const")) continue; + if (Token::Match(tok->previous(), "%str%")) + continue; // Very likely a typelist if (Token::Match(tok->tokAt(-2), "%type% ,") || Token::Match(tok->next(), ", %type%")) continue; From fecf0e5a6edfe46ef5e6c45064224185fc1987b3 Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Tue, 25 Nov 2025 13:48:52 +0100 Subject: [PATCH 2/4] Update testvalueflow.cpp --- test/testvalueflow.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/test/testvalueflow.cpp b/test/testvalueflow.cpp index 71578810017..e1d5924e702 100644 --- a/test/testvalueflow.cpp +++ b/test/testvalueflow.cpp @@ -9066,8 +9066,8 @@ class TestValueFlow : public TestFixture { ASSERT_EQUALS(false, testValueOfX(code, 5U, 0)); } - void valueFlowBailoutIncompleteVar() { // #12526 - bailout( + void valueFlowBailoutIncompleteVar() { + bailout( // #12526 "int f1() {\n" " return VALUE_1;\n" "}\n" @@ -9080,6 +9080,13 @@ class TestValueFlow : public TestFixture { "[test.cpp:2]: (debug) valueFlowConditionExpressions bailout: Skipping function due to incomplete variable VALUE_1\n" "[test.cpp:6]: (debug) valueFlowConditionExpressions bailout: Skipping function due to incomplete variable VALUE_2\n", errout_str()); + + bailout( + "std::string_view f() {\n" + " return \"abc\"sv;\n" + "}\n" + ); + ASSERT_EQUALS_WITHOUT_LINENUMBERS("", errout_str()); } void valueFlowBailoutNoreturn() { // #13718 From 5c9a5e5462d7ba32578df6fd852a71774d0a648a Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Tue, 25 Nov 2025 14:26:59 +0100 Subject: [PATCH 3/4] Update std.c --- test/cfg/std.c | 1 - 1 file changed, 1 deletion(-) diff --git a/test/cfg/std.c b/test/cfg/std.c index 32b6fe61534..b96f1bf8317 100644 --- a/test/cfg/std.c +++ b/test/cfg/std.c @@ -5036,7 +5036,6 @@ void invalidPrintfArgType_printf(void) // #7016 uint8_t n = 7; // TODO cppcheck-suppress invalidPrintfArgType_uint - // cppcheck-suppress valueFlowBailoutIncompleteVar printf("%" PRIi16 "\n", n); } From ef14d9a48ce527f133423b0e38d6582e989f273c Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Tue, 25 Nov 2025 14:59:03 +0100 Subject: [PATCH 4/4] Update testvalueflow.cpp --- test/testvalueflow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testvalueflow.cpp b/test/testvalueflow.cpp index e1d5924e702..8762c5141d6 100644 --- a/test/testvalueflow.cpp +++ b/test/testvalueflow.cpp @@ -9080,7 +9080,7 @@ class TestValueFlow : public TestFixture { "[test.cpp:2]: (debug) valueFlowConditionExpressions bailout: Skipping function due to incomplete variable VALUE_1\n" "[test.cpp:6]: (debug) valueFlowConditionExpressions bailout: Skipping function due to incomplete variable VALUE_2\n", errout_str()); - + bailout( "std::string_view f() {\n" " return \"abc\"sv;\n"