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
This commit is contained in:
Paolo Carlini 2015-01-20 13:39:10 +00:00 committed by Paolo Carlini
parent 237c70c352
commit 67ee3e618e
3 changed files with 23 additions and 0 deletions

View file

@ -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

View file

@ -0,0 +1,5 @@
// PR c++/59937
// { dg-do compile { target c++11 } }
constexpr const char * const &r = "";
constexpr const char * const &s = r;

View file

@ -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, "");
}