diff options
author | Jason Merrill <jason@redhat.com> | 2020-03-05 10:11:36 -0500 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2020-03-05 10:14:13 -0500 |
commit | a258e46458043b11495faef119489a776eb68f60 (patch) | |
tree | 7b447684c2b65bd70bd809119287f186e163f10e | |
parent | a2ec7c4aafbcd517eb563f1df32eedf39b27141b (diff) | |
download | gcc-a258e46458043b11495faef119489a776eb68f60.zip gcc-a258e46458043b11495faef119489a776eb68f60.tar.gz gcc-a258e46458043b11495faef119489a776eb68f60.tar.bz2 |
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.C | 12 |
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 0000000..83e3155 --- /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); +} |