Skip to content

Commit

Permalink
Update testautovariables.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github authored Apr 5, 2024
1 parent e9e856c commit b2bc09d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/testautovariables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2815,6 +2815,16 @@ class TestAutoVariables : public TestFixture {
" return ss;\n"
"}\n");
ASSERT_EQUALS("", errout_str());

check("void f() {\n" // #12568
" std::string str;\n"
" {\n"
" std::unique_ptr<char[]> b(new char[1]{});\n"
" str.assign(b.get());\n"
" }\n"
" std::cerr << str;\n"
"}\n");
ASSERT_EQUALS("", errout_str());
}

void danglingLifetimeContainerView()
Expand Down

0 comments on commit b2bc09d

Please sign in to comment.