diff --git a/test/testvalueflow.cpp b/test/testvalueflow.cpp index 33eab3b875d..7a6dc7e6329 100644 --- a/test/testvalueflow.cpp +++ b/test/testvalueflow.cpp @@ -6992,6 +6992,14 @@ class TestValueFlow : public TestFixture { " if (s.empty()) {}\n" "}"; ASSERT_EQUALS("", isPossibleContainerSizeValue(tokenValues(code, "s . empty"), 0)); + + code = "int f(const std::string& str) {\n" + " std::istringstream iss(str);\n" + " std::vector v{ std::istream_iterator(iss), {} };\n" + " auto x = v.size();\n" + " return x;\n" + "}"; + ASSERT_EQUALS(false, testValueOfXKnown(code, 5U, 2)); } void valueFlowContainerElement()