From a63d871eac0e57002b4ab4e1522f3f3851183b5e Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Fri, 2 May 2025 10:47:01 -0400 Subject: [PATCH] c++: add fixed testcase [PR85944] This testcase was incidentally fixed by r16-325 for PR119162. PR c++/85944 gcc/testsuite/ChangeLog: * g++.dg/cpp0x/constexpr-temp3.C: New test. --- gcc/testsuite/g++.dg/cpp0x/constexpr-temp3.C | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/constexpr-temp3.C diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-temp3.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-temp3.C new file mode 100644 index 00000000000..584472c7c84 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-temp3.C @@ -0,0 +1,8 @@ +// PR c++/85944 +// { dg-do compile { target c++11 } } + +constexpr bool f(int const & x) { + return &x; +} + +constexpr auto x = f(0); -- 2.47.2