Skip to content

Commit 83c984a

Browse files
Update teststl.cpp
1 parent 63d1511 commit 83c984a

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

test/teststl.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,6 +1010,12 @@ class TestStl : public TestFixture {
10101010
ASSERT_EQUALS(
10111011
"[test.cpp:2:12] -> [test.cpp:4:21]: (warning) Either the condition 'col>textline.size()' is redundant or 'col' can have the value textline.size(). Expression 'textline[col]' causes access out of bounds. [containerOutOfBounds]\n",
10121012
errout_str());
1013+
1014+
check("void f(const std::vector<int>& v) {\n" // #12742
1015+
" for (unsigned i = 0; i < v.size();)\n"
1016+
" (void)v[i++];\n"
1017+
"}\n");
1018+
ASSERT_EQUALS("", errout_str());
10131019
}
10141020

10151021
void outOfBoundsIndexExpression() {

0 commit comments

Comments
 (0)