aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2020-03-05 10:11:36 -0500
committerJason Merrill <jason@redhat.com>2020-03-05 10:14:13 -0500
commita258e46458043b11495faef119489a776eb68f60 (patch)
tree7b447684c2b65bd70bd809119287f186e163f10e
parenta2ec7c4aafbcd517eb563f1df32eedf39b27141b (diff)
c++: Add test for PR91607.
PR c++/91607 * g++.dg/cpp0x/constexpr-const3.C: New.
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-const3.C12
1 files changed, 12 insertions, 0 deletions
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);
+}