[gcc(refs/vendors/ibm/heads/perf)] c++: Add test for PR91607.

Jiu Fu Guo guojiufu@gcc.gnu.org
Thu Mar 19 06:08:25 GMT 2020


https://gcc.gnu.org/g:a258e46458043b11495faef119489a776eb68f60

commit a258e46458043b11495faef119489a776eb68f60
Author: Jason Merrill <jason@redhat.com>
Date:   Thu Mar 5 10:11:36 2020 -0500

    c++: Add test for PR91607.
    
         PR c++/91607
         * g++.dg/cpp0x/constexpr-const3.C: New.

Diff:
---
 gcc/testsuite/g++.dg/cpp0x/constexpr-const3.C | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-const3.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-const3.C
new file mode 100644
index 00000000000..83e3155c78d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-const3.C
@@ -0,0 +1,12 @@
+// PR c++/91607
+// { dg-do compile { target c++11 } }
+
+enum A { a };
+constexpr A f(const A x) { return x; }
+
+int main()
+{
+  constexpr A a0 = f(a);
+  constexpr A a1 {};
+  constexpr A a2 = f(a1);
+}


More information about the Gcc-cvs mailing list