diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2015-01-20 13:39:10 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2015-01-20 13:39:10 +0000 |
commit | 67ee3e618e0c30930bae1d21281ecfc7cc2c0fda (patch) | |
tree | 392d0ce0271f122d445c13a76a5cbd8052cdab3d /gcc | |
parent | 237c70c35210df194355513b3e4edf384e2e46c3 (diff) | |
download | gcc-67ee3e618e0c30930bae1d21281ecfc7cc2c0fda.zip gcc-67ee3e618e0c30930bae1d21281ecfc7cc2c0fda.tar.gz gcc-67ee3e618e0c30930bae1d21281ecfc7cc2c0fda.tar.bz2 |
re PR c++/59937 ([constexpr] bogus diagnostic "used in its own initializer")
2015-01-20 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/59937
* g++.dg/cpp0x/constexpr-59937-1.C: New.
* g++.dg/cpp0x/constexpr-59937-2.C: Likewise.
From-SVN: r219894
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/constexpr-59937-1.C | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/constexpr-59937-2.C | 12 |
3 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1049e67..4d45666 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2015-01-20 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/59937 + * g++.dg/cpp0x/constexpr-59937-1.C: New. + * g++.dg/cpp0x/constexpr-59937-2.C: Likewise. + 2015-01-20 Richard Biener <rguenther@suse.de> 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 0000000..d9fbd33 --- /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 0000000..e67d946 --- /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<typename T> constexpr bool truth(const T&) { return true; } + +template<typename T> +void test() +{ + int i[1]; + constexpr bool untrue = !truth(i); + static_assert(!untrue, ""); +} |