aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2006-10-17 02:01:27 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2006-10-17 02:01:27 +0000
commitfb8549a1d765f1c8c741c39b9022fefbc09be0de (patch)
tree1089efe692fb9971979e0d3ba4cda22269ebb472 /gcc/cp
parent26da58ddfaccabb2243f08d10c390e7f1f452873 (diff)
downloadgcc-fb8549a1d765f1c8c741c39b9022fefbc09be0de.zip
gcc-fb8549a1d765f1c8c741c39b9022fefbc09be0de.tar.gz
gcc-fb8549a1d765f1c8c741c39b9022fefbc09be0de.tar.bz2
re PR c++/27270 (ICE in process_init_constructor_array, at cp/typeck2.c:788)
PR c++/27270 * typeck2.c (process_init_constructor_array): Reword comment. * pt.c (tsubst_copy_and_built): Call reshape_init before calling digest_init. PR c++/27270 * g++.dg/ext/complit8.C: New test. From-SVN: r117814
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/pt.c5
-rw-r--r--gcc/cp/typeck2.c4
3 files changed, 11 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index ff47180..e603fd5 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,10 @@
2006-10-16 Mark Mitchell <mark@codesourcery.com>
+ PR c++/27270
+ * typeck2.c (process_init_constructor_array): Reword comment.
+ * pt.c (tsubst_copy_and_built): Call reshape_init before calling
+ digest_init.
+
PR c++/29408
* parser.c (cp_parser_using_declaration): Stop parsing when
something goes wrong with an access declaration.
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 744871f..ce5a809 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -9351,7 +9351,10 @@ tsubst_copy_and_build (tree t,
TREE_HAS_CONSTRUCTOR (r) = TREE_HAS_CONSTRUCTOR (t);
if (type)
- return digest_init (type, r);
+ {
+ r = reshape_init (type, r);
+ return digest_init (type, r);
+ }
return r;
}
diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c
index 6d847cb..725c85f 100644
--- a/gcc/cp/typeck2.c
+++ b/gcc/cp/typeck2.c
@@ -791,8 +791,8 @@ process_init_constructor_array (tree type, tree init)
/* Vectors are like simple fixed-size arrays. */
len = TYPE_VECTOR_SUBPARTS (type);
- /* There cannot be more initializers than needed (or reshape_init would
- detect this before we do. */
+ /* There cannot be more initializers than needed as otherwise
+ reshape_init would have already rejected the initializer. */
if (!unbounded)
gcc_assert (VEC_length (constructor_elt, v) <= len);