Skip to content

Commit

Permalink
Update testvalueflow.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github committed Aug 7, 2024
1 parent b8522c5 commit 3f01cfe
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/testvalueflow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6942,6 +6942,13 @@ class TestValueFlow : public TestFixture {
" return x;\n"
"}\n";
ASSERT_EQUALS(true, testValueOfXKnown(code, 5U, 1));

code = "std::string f() {\n" // #12993
" std::string a[1];\n"
" a->clear();\n"
" return a[0];\n"
"}\n";
ASSERT(!isKnownContainerSizeValue(tokenValues(code, "a [ 0"), 0).empty());
}

void valueFlowContainerElement()
Expand Down

0 comments on commit 3f01cfe

Please sign in to comment.