]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/56403 (internal compiler error: in build_zero_init_1, at cp/init.c:279)
authorJakub Jelinek <jakub@redhat.com>
Thu, 14 Mar 2013 16:11:37 +0000 (17:11 +0100)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 14 Mar 2013 16:11:37 +0000 (12:11 -0400)
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: r196660

gcc/cp/ChangeLog
gcc/cp/init.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/torture/pr56403.C [new file with mode: 0644]

index 5ddfb2f33fb87cf94c215b9e64452469d5288813..5a4d95fea8b25ba4f8203cc28cabfcb8a84b06c1 100644 (file)
@@ -1,3 +1,9 @@
+2013-03-14  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-09  Jason Merrill  <jason@redhat.com>
 
        PR c++/56247
index 091ac73ae1e1772929af78c0df07b13c05a926ef..e3e74b19e386a0fea3470b4f52ae83902cfd8399 100644 (file)
@@ -181,7 +181,7 @@ build_zero_init_1 (tree type, tree nelts, bool static_storage_p,
     ;
   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,gc) *v = NULL;
index 401c1ed54a63666253841c62fb6617926b030621..46e3bd2ccee1e3fcb876e8cee4af56dbd0e95732 100644 (file)
@@ -1,3 +1,8 @@
+2013-03-14  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/56403
+       * g++.dg/torture/pr56403.C: New test.
+
 2013-03-13  Paul Thomas  <pault@gcc.gnu.org>
 
        PR fortran/56575
diff --git a/gcc/testsuite/g++.dg/torture/pr56403.C b/gcc/testsuite/g++.dg/torture/pr56403.C
new file mode 100644 (file)
index 0000000..27b6eeb
--- /dev/null
@@ -0,0 +1,12 @@
+// PR c++/56403
+// { dg-do compile }
+
+#include <stdarg.h>
+
+struct S { va_list err_args; };
+
+void *
+foo ()
+{
+  return new S ();
+}