OSDN Git Service

PR c++/56403
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 25 Feb 2013 14:41:26 +0000 (14:41 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 25 Feb 2013 14:41:26 +0000 (14:41 +0000)
* init.c (build_zero_init_1): Use RECORD_OR_UNION_CODE_P instead
of CLASS_TYPE_P.

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

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@196260 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 4a2baa0..eaa43e1 100644 (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
index 6f46404..697f11f 100644 (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;
index 4be79be..a33bed4 100644 (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:
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 ();
+}