re PR c++/56403 (internal compiler error: in build_zero_init_1, at cp/init.c:279)

PR c++/56403
	* init.c (build_zero_init_1): Use RECORD_OR_UNION_CODE_P instead
	of CLASS_TYPE_P.

	* g++.dg/torture/pr56403.C: New test.

From-SVN: r196260
This commit is contained in:
Jakub Jelinek 2013-02-25 15:41:26 +01:00 committed by Jakub Jelinek
parent 6d65e8f1fc
commit 5621a5d7b1
4 changed files with 24 additions and 1 deletions

View file

@ -1,3 +1,9 @@
2013-02-24 Jakub Jelinek <jakub@redhat.com>
PR c++/56403
* init.c (build_zero_init_1): Use RECORD_OR_UNION_CODE_P instead
of CLASS_TYPE_P.
2013-02-22 Jason Merrill <jason@redhat.com>
PR c++/40405

View file

@ -179,7 +179,7 @@ build_zero_init_1 (tree type, tree nelts, bool static_storage_p,
init = convert (type, nullptr_node);
else if (SCALAR_TYPE_P (type))
init = convert (type, integer_zero_node);
else if (CLASS_TYPE_P (type))
else if (RECORD_OR_UNION_CODE_P (TREE_CODE (type)))
{
tree field;
vec<constructor_elt, va_gc> *v = NULL;

View file

@ -1,3 +1,8 @@
2013-02-24 Jakub Jelinek <jakub@redhat.com>
PR c++/56403
* g++.dg/torture/pr56403.C: New test.
2013-02-25 Catherine Moore <clm@codesourcery.com>
Revert:

View file

@ -0,0 +1,12 @@
// PR c++/56403
// { dg-do compile }
#include <stdarg.h>
struct S { va_list err_args; };
void *
foo ()
{
return new S ();
}