We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 311747d commit ccd4e46Copy full SHA for ccd4e46
1 file changed
test/teststl.cpp
@@ -5339,6 +5339,13 @@ class TestStl : public TestFixture {
5339
" return it;\n"
5340
"}\n", dinit(CheckOptions, $.inconclusive = true));
5341
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());
5349
}
5350
5351
void loopAlgoElementAssign() {
0 commit comments