diff options
author | Jakub Jelinek <jakub@redhat.com> | 2006-05-17 10:42:47 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2006-05-17 10:42:47 +0200 |
commit | aa0e52dbd5a20acf70b8f5f2ffa407cdfcb9f737 (patch) | |
tree | 4e1059003fcc11ced87eaea21db27730e1747465 /gcc/cp | |
parent | 761041be912de3a0344a507dbb718a49a9c19434 (diff) | |
download | gcc-aa0e52dbd5a20acf70b8f5f2ffa407cdfcb9f737.zip gcc-aa0e52dbd5a20acf70b8f5f2ffa407cdfcb9f737.tar.gz gcc-aa0e52dbd5a20acf70b8f5f2ffa407cdfcb9f737.tar.bz2 |
re PR c++/27491 (ICE on variable initialization)
PR c++/27491
* semantics.c (finish_compound_literal): Only set TREE_HAS_CONSTRUCTOR
on CONSTRUCTORs.
* g++.dg/init/brace5.C: New test.
From-SVN: r113847
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/semantics.c | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 8a31857..b54dfb8 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 2006-05-17 Jakub Jelinek <jakub@redhat.com> + PR c++/27491 + * semantics.c (finish_compound_literal): Only set TREE_HAS_CONSTRUCTOR + on CONSTRUCTORs. + PR middle-end/27415 * parser.c (cp_parser_omp_parallel): Set OMP_PARALLEL_COMBINED on combined parallel workshare constructs. diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 1e315e2..f7a3b40 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -2033,7 +2033,8 @@ finish_compound_literal (tree type, VEC(constructor_elt,gc) *initializer_list) } /* Mark it as a compound-literal. */ - TREE_HAS_CONSTRUCTOR (compound_literal) = 1; + if (TREE_CODE (compound_literal) == CONSTRUCTOR) + TREE_HAS_CONSTRUCTOR (compound_literal) = 1; return compound_literal; } |