Skip to content

Commit 036aa9b

Browse files
Update teststl.cpp
1 parent c17b7e2 commit 036aa9b

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

test/teststl.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6544,6 +6544,17 @@ class TestStl : public TestFixture {
65446544
"}\n",
65456545
dinit(CheckOptions, $.inconclusive = true));
65466546
ASSERT_EQUALS("", errout_str());
6547+
6548+
check("struct S { int i; };\n"
6549+
"void f() {\n"
6550+
" std::vector<std::unique_ptr<S>> v;\n"
6551+
" for (int i = 0; i < 5; ++i) {\n"
6552+
" std::unique_ptr<S>& r{ v.emplace_back(std::make_unique<S>()) };\n"
6553+
" r->i = 1;\n"
6554+
" }\n"
6555+
"}\n",
6556+
dinit(CheckOptions, $.inconclusive = true));
6557+
ASSERT_EQUALS("", errout_str());
65476558
}
65486559

65496560
void findInsert() {

0 commit comments

Comments
 (0)