From d0797ad1463ba060f2a530bafa17cdd1ece5bd57 Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Thu, 26 Sep 2024 15:53:11 +0200 Subject: [PATCH] Update testvalueflow.cpp --- test/testvalueflow.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) 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()