Skip to content

Commit 73c9967

Browse files
Add test for #11583
1 parent 5490362 commit 73c9967

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎test/teststl.cpp‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7078,6 +7078,18 @@ class TestStl : public TestFixture {
70787078
dinit(CheckOptions, $.inconclusive = true));
70797079
ASSERT_EQUALS("", errout_str());
70807080

7081+
check("template<typename T>\n" // #11583
7082+
"int g() { return 0; }\n"
7083+
"void f() {\n"
7084+
" std::vector<int> v(1);\n"
7085+
" auto itr = v.begin() + g<int>();\n"
7086+
" std::vector<int> v2(itr, v.end());\n"
7087+
" v.erase(itr, v.end());\n"
7088+
" v.push_back(v2.size());\n"
7089+
"}\n",
7090+
dinit(CheckOptions, $.inconclusive = true));
7091+
ASSERT_EQUALS("", errout_str());
7092+
70817093
// #13410
70827094
check("int f(std::vector<int>& v) {\n"
70837095
" const int* i = &*v.cbegin();\n"

0 commit comments

Comments
 (0)