From: Jason Merrill Date: Thu, 5 Mar 2020 15:11:36 +0000 (-0500) Subject: c++: Add test for PR91607. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a258e46458043b11495faef119489a776eb68f60;p=gcc.git c++: Add test for PR91607. PR c++/91607 * g++.dg/cpp0x/constexpr-const3.C: New. --- 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); +}