We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dbfd3ea commit 9e6f7ebCopy full SHA for 9e6f7eb
1 file changed
test/teststl.cpp
@@ -980,6 +980,14 @@ class TestStl : public TestFixture {
980
"}\n");
981
ASSERT_EQUALS("[test.cpp:4:13]: error: Out of bounds access in 'x[3]', if 'x' size is 1 and '3' is 3 [containerOutOfBounds]\n",
982
errout_str());
983
+
984
+ checkNormal("int main() {\n"
985
+ " const char a[] = \"abc\";\n"
986
+ " std::string_view x{ a };\n"
987
+ " return x[5];\n"
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
993
void outOfBoundsSymbolic()
0 commit comments