Index: testsuite/g++.dg/other/vararg-3.C =================================================================== --- testsuite/g++.dg/other/vararg-3.C (revision 0) +++ testsuite/g++.dg/other/vararg-3.C (revision 0) @@ -0,0 +1,17 @@ +// 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; +} + Index: cp/cp-objcp-common.h =================================================================== --- cp/cp-objcp-common.h (revision 142960) +++ cp/cp-objcp-common.h (working copy) @@ -115,6 +115,8 @@ extern tree objcp_tsubst_copy_and_build #undef LANG_HOOKS_MAKE_TYPE #define LANG_HOOKS_MAKE_TYPE cxx_make_type +#undef LANG_HOOKS_SET_IS_AGGR_TYPE +#define LANG_HOOKS_SET_IS_AGGR_TYPE set_is_aggr_type #undef LANG_HOOKS_TYPE_FOR_MODE #define LANG_HOOKS_TYPE_FOR_MODE c_common_type_for_mode #undef LANG_HOOKS_TYPE_FOR_SIZE Index: cp/cp-tree.h =================================================================== --- cp/cp-tree.h (revision 142960) +++ cp/cp-tree.h (working copy) @@ -4498,6 +4498,7 @@ extern void retrofit_lang_decl (tree); extern tree copy_decl (tree); extern tree copy_type (tree); extern tree cxx_make_type (enum tree_code); +extern void set_is_aggr_type (tree); extern tree make_class_type (enum tree_code); extern void yyerror (const char *); extern void yyhook (int); Index: cp/lex.c =================================================================== --- cp/lex.c (revision 142960) +++ cp/lex.c (working copy) @@ -661,6 +661,12 @@ cxx_make_type (enum tree_code code) return t; } +void +set_is_aggr_type (tree t) +{ + SET_CLASS_TYPE_P (t, 1); +} + tree make_class_type (enum tree_code code) { Index: langhooks.h =================================================================== --- langhooks.h (revision 142960) +++ langhooks.h (working copy) @@ -74,6 +74,10 @@ struct lang_hooks_for_types language-specific processing is required. */ tree (*make_type) (enum tree_code); + /* For C++ family of languages, Set CLASS_TYPE_P for T. T must be + a class, struct, or union type. */ + void (*set_is_aggr_type) (tree); + /* Return what kind of RECORD_TYPE this is, mainly for purposes of debug information. If not defined, record types are assumed to be structures. */ Index: config/alpha/alpha.c =================================================================== --- config/alpha/alpha.c (revision 142960) +++ config/alpha/alpha.c (working copy) @@ -5779,7 +5779,7 @@ alpha_build_builtin_va_list (void) TREE_CHAIN (record) = type_decl; TYPE_NAME (record) = type_decl; - /* C++? SET_IS_AGGR_TYPE (record, 1); */ + (*lang_hooks.types.set_is_aggr_type) (record); /* Dummy field to prevent alignment warnings. */ space = build_decl (FIELD_DECL, NULL_TREE, integer_type_node); Index: langhooks-def.h =================================================================== --- langhooks-def.h (revision 142960) +++ langhooks-def.h (working copy) @@ -155,6 +155,7 @@ extern tree lhd_make_node (enum tree_cod /* Types hooks. There are no reasonable defaults for most of them, so we create a compile-time error instead. */ #define LANG_HOOKS_MAKE_TYPE lhd_make_node +#define LANG_HOOKS_SET_IS_AGGR_TYPE lhd_do_nothing_t #define LANG_HOOKS_CLASSIFY_RECORD NULL #define LANG_HOOKS_INCOMPLETE_TYPE_ERROR lhd_incomplete_type_error #define LANG_HOOKS_GENERIC_TYPE_P hook_bool_const_tree_false @@ -170,6 +171,7 @@ extern tree lhd_make_node (enum tree_cod #define LANG_HOOKS_FOR_TYPES_INITIALIZER { \ LANG_HOOKS_MAKE_TYPE, \ + LANG_HOOKS_SET_IS_AGGR_TYPE, \ LANG_HOOKS_CLASSIFY_RECORD, \ LANG_HOOKS_TYPE_FOR_MODE, \ LANG_HOOKS_TYPE_FOR_SIZE, \