Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/symboldatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion test/cfg/std.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
11 changes: 9 additions & 2 deletions test/testvalueflow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down
Loading