Commit 72114ca1 by Jason Merrill Committed by Jason Merrill

re PR c++/31488 (va_list considered non-POD)

        PR c++/31488
        * tree.c (pod_type_p): Return 1 for structs created by the back end.

From-SVN: r143308
parent 9251175f
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
......
......@@ -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;
......
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.
......
// 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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment