From 2f2e91d0007d50fd0f61c74db2ecff406cf33cd9 Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Mon, 8 Apr 2024 15:04:40 +0200 Subject: [PATCH] Update testautovariables.cpp --- test/testautovariables.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/testautovariables.cpp b/test/testautovariables.cpp index ef8cd776a2b..a9b68afb1b5 100644 --- a/test/testautovariables.cpp +++ b/test/testautovariables.cpp @@ -3063,6 +3063,12 @@ class TestAutoVariables : public TestFixture { ASSERT_EQUALS( "[test.cpp:4] -> [test.cpp:3] -> [test.cpp:4]: (error) Returning pointer to local variable 'ptr' that will be invalid when returning.\n", errout_str()); + + check("struct S { std::unique_ptr p; };\n" // #12600 + " int* f(const S* s) {\n" + " return s[0].p.get();\n" + "}\n"); + ASSERT_EQUALS("", errout_str()); } void danglingLifetime() { check("auto f() {\n"