Skip to content

Commit 9e6f7eb

Browse files
Update teststl.cpp
1 parent dbfd3ea commit 9e6f7eb

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

test/teststl.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -980,6 +980,14 @@ class TestStl : public TestFixture {
980980
"}\n");
981981
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",
982982
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());
983991
}
984992

985993
void outOfBoundsSymbolic()

0 commit comments

Comments
 (0)