We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4c9e107 commit 289be50Copy full SHA for 289be50
1 file changed
test/teststl.cpp
@@ -988,6 +988,16 @@ class TestStl : public TestFixture {
988
"}\n");
989
ASSERT_EQUALS("[test.cpp:4:13]: error: Out of bounds access in 'x[5]', if 'x' size is 4 and '5' is 5 [containerOutOfBounds]\n",
990
errout_str());
991
+
992
+ checkNormal("int f(const std::string& v) {\n"
993
+ " return v[2];\n"
994
+ "}\n"
995
+ "int main() {\n"
996
+ " std::string_view x{ \"a\" };\n"
997
+ " return f(std::string(x));\n"
998
+ "}\n");
999
+ ASSERT_EQUALS("[test.cpp:2:13]: error: Out of bounds access in 'v[2]', if 'v' size is 1 and '2' is 2 [containerOutOfBounds]\n",
1000
+ errout_str());
1001
}
1002
1003
void outOfBoundsSymbolic()
0 commit comments