Skip to content

Commit 289be50

Browse files
Update teststl.cpp
1 parent 4c9e107 commit 289be50

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

test/teststl.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -988,6 +988,16 @@ class TestStl : public TestFixture {
988988
"}\n");
989989
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",
990990
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());
9911001
}
9921002

9931003
void outOfBoundsSymbolic()

0 commit comments

Comments
 (0)