From 67ee3e618e0c30930bae1d21281ecfc7cc2c0fda Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Tue, 20 Jan 2015 13:39:10 +0000 Subject: [PATCH] re PR c++/59937 ([constexpr] bogus diagnostic "used in its own initializer") 2015-01-20 Paolo Carlini PR c++/59937 * g++.dg/cpp0x/constexpr-59937-1.C: New. * g++.dg/cpp0x/constexpr-59937-2.C: Likewise. From-SVN: r219894 --- gcc/testsuite/ChangeLog | 6 ++++++ gcc/testsuite/g++.dg/cpp0x/constexpr-59937-1.C | 5 +++++ gcc/testsuite/g++.dg/cpp0x/constexpr-59937-2.C | 12 ++++++++++++ 3 files changed, 23 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/constexpr-59937-1.C create mode 100644 gcc/testsuite/g++.dg/cpp0x/constexpr-59937-2.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1049e672c0f..4d45666b0e0 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2015-01-20 Paolo Carlini + + PR c++/59937 + * g++.dg/cpp0x/constexpr-59937-1.C: New. + * g++.dg/cpp0x/constexpr-59937-2.C: Likewise. + 2015-01-20 Richard Biener PR ipa/64684 diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-59937-1.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-59937-1.C new file mode 100644 index 00000000000..d9fbd33c94f --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-59937-1.C @@ -0,0 +1,5 @@ +// PR c++/59937 +// { dg-do compile { target c++11 } } + +constexpr const char * const &r = ""; +constexpr const char * const &s = r; diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-59937-2.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-59937-2.C new file mode 100644 index 00000000000..e67d9467a46 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-59937-2.C @@ -0,0 +1,12 @@ +// PR c++/59937 +// { dg-do compile { target c++11 } } + +template constexpr bool truth(const T&) { return true; } + +template +void test() +{ + int i[1]; + constexpr bool untrue = !truth(i); + static_assert(!untrue, ""); +} -- 2.30.2