diff options
author | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-04-23 01:06:54 +0000 |
---|---|---|
committer | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-04-23 01:06:54 +0000 |
commit | edbb6c80c4a1d56cfefc01d114cb916400937c22 (patch) | |
tree | f887ec91f724eba796a864326763be5884693725 | |
parent | 5cf0296ecc13e6cd7d3b87bcafa44dd7f96ffefa (diff) | |
download | gcc-edbb6c80c4a1d56cfefc01d114cb916400937c22.tar.gz |
* init.c (build_aggr_init): Fix accidental use of C99 construct in
previous change.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@81067 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/init.c | 4 |
2 files changed, 7 insertions, 1 deletions
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 <mark@codesourcery.com> + * 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) |