c++: Add test for PR91607.
authorJason Merrill <jason@redhat.com>
Thu, 5 Mar 2020 15:11:36 +0000 (10:11 -0500)
committerJason Merrill <jason@redhat.com>
Thu, 5 Mar 2020 15:14:13 +0000 (10:14 -0500)
     PR c++/91607
     * g++.dg/cpp0x/constexpr-const3.C: New.

gcc/testsuite/g++.dg/cpp0x/constexpr-const3.C [new file with mode: 0644]

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