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
This commit is contained in:
parent
9251175fa5
commit
72114ca181
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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.
|
||||
|
16
gcc/testsuite/g++.dg/other/vararg-3.C
Normal file
16
gcc/testsuite/g++.dg/other/vararg-3.C
Normal file
@ -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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user