From efb5b48e4b6cb84f30985afdbf5e8f89fc31c93d Mon Sep 17 00:00:00 2001 From: orbitcowboy Date: Mon, 5 Aug 2024 19:50:58 +0200 Subject: [PATCH] Ticket 12966 (returnDanglingLifetime): Added extra regression test. --- test/cfg/std.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/cfg/std.cpp b/test/cfg/std.cpp index 64623cd8e67..c390ea4449a 100644 --- a/test/cfg/std.cpp +++ b/test/cfg/std.cpp @@ -4917,6 +4917,16 @@ void stdspan() #endif } +void std::span returnDanglingLifetime_std_span0() { + static int a[10]{}; + return a; +} + +std::span returnDanglingLifetime_std_span1() { + static std::vector v; + return v; +} + void beginEnd() { std::vector v;