From 3f01cfe2f5bd45e79274df2ec590246cf2ebe920 Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Wed, 7 Aug 2024 16:01:50 +0200 Subject: [PATCH] Update testvalueflow.cpp --- test/testvalueflow.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/testvalueflow.cpp b/test/testvalueflow.cpp index d0413682724..8ede4292d3c 100644 --- a/test/testvalueflow.cpp +++ b/test/testvalueflow.cpp @@ -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()