We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3649446 commit 7de5296Copy full SHA for 7de5296
1 file changed
test/teststl.cpp
@@ -972,6 +972,14 @@ class TestStl : public TestFixture {
972
"bool g() { return f(\" \"); }\n");
973
ASSERT_EQUALS("[test.cpp:1:44]: error: Out of bounds access in 's[500]', if 's' size is 1 and '500' is 500 [containerOutOfBounds]\n",
974
errout_str());
975
+
976
+ checkNormal("int main() {\n" // #14342
977
+ " const int a[] = { 1, 2, 3 };\n"
978
+ " std::span<const int> x{ a };\n"
979
+ " return x[3];\n"
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
985
void outOfBoundsSymbolic()
0 commit comments