diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index dc6dbcfd271..f654b18f735 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2004-04-22 Mark Mitchell + * init.c (build_aggr_init): Fix accidental use of C99 construct in + previous change. + * class.c (initialize_array): Don't set TREE_HAS_CONSTRUCTOR on braced initializer. * cp-tree.h (BRACE_ENCLOSED_INITIALIZER_P): New macro. @@ -8,6 +11,7 @@ (build_aggr_init): Adjust to handle brace-enclosed initializers correctly. (expand_default_init): Use BRACE_ENCLOSED_INITIALIZER_P. + * parser.c (cp_parser_initializer_clause): Do not set TREE_HAS_CONSTRUCTOR on the initializer. * rtti.c (tinfo_base_init): Likewise. diff --git a/gcc/cp/init.c b/gcc/cp/init.c index 58d9f6db97f..6811aaab58e 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -1090,6 +1090,8 @@ build_aggr_init (tree exp, tree init, int flags) if (TREE_CODE (type) == ARRAY_TYPE) { + tree itype; + /* An array may not be initialized use the parenthesized initialization form -- unless the initializer is "()". */ if (init && TREE_CODE (init) == TREE_LIST) @@ -1099,7 +1101,7 @@ build_aggr_init (tree exp, tree init, int flags) } /* Must arrange to initialize each element of EXP from elements of INIT. */ - tree itype = init ? TREE_TYPE (init) : NULL_TREE; + itype = init ? TREE_TYPE (init) : NULL_TREE; if (cp_type_quals (type) != TYPE_UNQUALIFIED) TREE_TYPE (exp) = TYPE_MAIN_VARIANT (type); if (itype && cp_type_quals (itype) != TYPE_UNQUALIFIED)