aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/tree.c4
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/g++.dg/other/vararg-3.C16
4 files changed, 28 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index c81a1e6..1a9ca4f 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2009-01-12 Jason Merrill <jason@redhat.com>
+
+ PR c++/31488
+ * tree.c (pod_type_p): Return 1 for structs created by the back end.
+
2009-01-12 Jakub Jelinek <jakub@redhat.com>
PR c/32041
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 1f2c631..ad84cc8 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -2127,8 +2127,10 @@ pod_type_p (const_tree t)
if (TREE_CODE (t) == VECTOR_TYPE)
return 1; /* vectors are (small) arrays of scalars */
- if (! CLASS_TYPE_P (t))
+ if (! RECORD_OR_UNION_CODE_P (TREE_CODE (t)))
return 0; /* other non-class type (reference or function) */
+ if (! CLASS_TYPE_P (t))
+ return 1; /* struct created by the back end */
if (CLASSTYPE_NON_POD_P (t))
return 0;
return 1;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 5a54e1e..9ae7b39 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2009-01-12 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/other/vararg-3.C: New test.
+
2009-01-12 Daniel Jacobowitz <dan@codesourcery.com>
* gcc.target/powerpc/ppc-spe.c: Compile for all EABI targets.
diff --git a/gcc/testsuite/g++.dg/other/vararg-3.C b/gcc/testsuite/g++.dg/other/vararg-3.C
new file mode 100644
index 0000000..4585f32
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/vararg-3.C
@@ -0,0 +1,16 @@
+// PR c++/31488: va_list considered non-POD on alpha
+// { dg-do compile }
+
+typedef __builtin_va_list __gnuc_va_list;
+typedef __gnuc_va_list va_list;
+
+extern int foo (int a, int b, ...);
+
+int bar (int a, int b, ...)
+{
+ va_list args;
+ __builtin_va_start(args,b);
+ int result = foo (a, b, args);
+ __builtin_va_end(args);
+ return result;
+}