PR c++/51462 - ICE in cx_check_missing_mem_inits

gcc/cp/

	PR c++/51462
	* semantics.c (cx_check_missing_mem_inits): Don't assert in case
	of error.

gcc/testsuite/

	PR c++/51462
	* g++.dg/cpp0x/constexpr-99.C: New test.

From-SVN: r182806
This commit is contained in:
Dodji Seketeli 2012-01-02 17:00:13 +00:00 committed by Dodji Seketeli
parent 7d510a821a
commit 358b9253c1
4 changed files with 26 additions and 1 deletions

View file

@ -1,3 +1,9 @@
2012-01-02 Dodji Seketeli <dodji@redhat.com>
PR c++/51462
* semantics.c (cx_check_missing_mem_inits): Don't assert in case
of error.
2012-01-02 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/20140

View file

@ -6051,7 +6051,8 @@ cx_check_missing_mem_inits (tree fun, tree body, bool complain)
/* It's OK to skip a member with a trivial constexpr ctor.
A constexpr ctor that isn't trivial should have been
added in by now. */
gcc_checking_assert (!TYPE_HAS_COMPLEX_DFLT (ftype));
gcc_checking_assert (!TYPE_HAS_COMPLEX_DFLT (ftype)
|| errorcount != 0);
continue;
}
error ("uninitialized member %qD in %<constexpr%> constructor",

View file

@ -1,3 +1,8 @@
2012-01-02 Dodji Seketeli <dodji@redhat.com>
PR c++/51462
* g++.dg/cpp0x/constexpr-99.C: New test.
2012-01-02 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/20140

View file

@ -0,0 +1,13 @@
// Origin PR c++/51462
// { dg-options "-std=c++11" }
struct A
{
int i = 0;
};
struct B
{
A a;
constexpr B() : a(0) {} // { dg-error "no matching function" }
};