]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c++: add fixed testcase [PR85944]
authorJason Merrill <jason@redhat.com>
Fri, 2 May 2025 14:47:01 +0000 (10:47 -0400)
committerJason Merrill <jason@redhat.com>
Sat, 3 May 2025 13:30:19 +0000 (09:30 -0400)
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 [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-temp3.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-temp3.C
new file mode 100644 (file)
index 0000000..584472c
--- /dev/null
@@ -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);