Skip to content

Commit ccd4e46

Browse files
Update teststl.cpp [skip ci]
1 parent 311747d commit ccd4e46

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

test/teststl.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5339,6 +5339,13 @@ class TestStl : public TestFixture {
53395339
" return it;\n"
53405340
"}\n", dinit(CheckOptions, $.inconclusive = true));
53415341
ASSERT_EQUALS("[test.cpp:18:5]: (error, inconclusive) Invalid iterator 'it' used. [eraseDereference]\n", errout_str());
5342+
5343+
check("int f(const std::vector<int>& v) {\n" // #11895
5344+
" auto it = v.end();\n"
5345+
" std::advance(it, -2);\n"
5346+
" return *it;\n"
5347+
"}\n", dinit(CheckOptions, $.inconclusive = true));
5348+
ASSERT_EQUALS("", errout_str());
53425349
}
53435350

53445351
void loopAlgoElementAssign() {

0 commit comments

Comments
 (0)