Skip to content

Commit aa4f867

Browse files
Update testautovariables.cpp
1 parent 36cf2df commit aa4f867

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

test/testautovariables.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3240,6 +3240,15 @@ class TestAutoVariables : public TestFixture {
32403240
" return s[0].p.get();\n"
32413241
"}\n");
32423242
ASSERT_EQUALS("", errout_str());
3243+
3244+
check("std::unique_ptr<int> g_p;\n" // #14568
3245+
"int* f() {\n"
3246+
" std::unique_ptr<int> tmp = std::make_unique<int>();\n"
3247+
" int* p = tmp.get();\n"
3248+
" g_p = std::move(tmp);\n"
3249+
" return p;\n"
3250+
"}\n");
3251+
ASSERT_EQUALS("", errout_str());
32433252
}
32443253
void danglingLifetime() {
32453254
check("auto f() {\n"

0 commit comments

Comments
 (0)