Skip to content

Commit c446906

Browse files
Update testvalueflow.cpp
1 parent 6ad6ce5 commit c446906

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

test/testvalueflow.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7171,6 +7171,15 @@ class TestValueFlow : public TestFixture {
71717171
" return a.size();\n"
71727172
"}\n";
71737173
ASSERT_EQUALS(true, tokenValues(code, "a . size", ValueFlow::Value::ValueType::CONTAINER_SIZE).empty());
7174+
7175+
code = "void f() {\n" // #14060
7176+
" std::stack<std::pair<int, int>> s;\n"
7177+
" s.emplace(0, 0);\n"
7178+
" s.pop();\n"
7179+
" bool x = s.empty();\n"
7180+
" return x;\n"
7181+
"}\n";
7182+
ASSERT_EQUALS(true, testValueOfXKnown(code, 6U, 1));
71747183

71757184
code = "std::vector<int> g();\n"
71767185
"std::vector<int> f() {\n"

0 commit comments

Comments
 (0)