]> 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:12:37 +0000 (17:12 +0100)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 14 Mar 2013 16:12:37 +0000 (12:12 -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: r196661

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

index a32b69ee5554d7c161232538b36c5913c6ff43a8..af8859f4bcf4b0f89358a7153747a62a1fdb8dcd 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-03-09  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/56534
index afd082c24bc5ae4df2e1c540e460550a65448d67..bb0e618fbeef26baf5360b30d82388a4692e7a80 100644 (file)
@@ -182,7 +182,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,gc) *v = NULL;
index 36b521b5ec4dd43c63731a25c93765eb8ffe3dea..1d3f9606719ed6f3852d97171d453e0af4678caf 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 ();
+}