aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2010-11-03 15:13:27 -0400
committerJason Merrill <jason@gcc.gnu.org>2010-11-03 15:13:27 -0400
commit0787e2e7a766f7a358abdc88e9e6d339ec2ed30d (patch)
tree7dcf026837cdc8e9a0bf268286cd6350bb21db2a /gcc/cp
parentf891030a4800ca9f6775988b5546231439704c3b (diff)
downloadgcc-0787e2e7a766f7a358abdc88e9e6d339ec2ed30d.zip
gcc-0787e2e7a766f7a358abdc88e9e6d339ec2ed30d.tar.gz
gcc-0787e2e7a766f7a358abdc88e9e6d339ec2ed30d.tar.bz2
re PR c++/46289 (ICE in build_constexpr_constructor_member_initializers, at cp/semantics.c:5513)
PR c++/46289 * semantics.c (build_constexpr_constructor_member_initializers): Avoid ICE on error. From-SVN: r166270
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/semantics.c5
2 files changed, 9 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index cac8a1a..7c4b082 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2010-11-03 Jason Merrill <jason@redhat.com>
+
+ PR c++/46289
+ * semantics.c (build_constexpr_constructor_member_initializers):
+ Avoid ICE on error.
+
2010-11-02 Dodji Seketeli <dodji@redhat.com>
* cp-tree.h (enum tsubst_flags)<tf_no_class_instantiations>:
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 3215410..562fab1 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -5507,10 +5507,9 @@ build_constexpr_constructor_member_initializers (tree type, tree body)
body = BIND_EXPR_BODY (body);
if (TREE_CODE (body) == CLEANUP_POINT_EXPR)
ok = build_data_member_initialization (body, &vec);
- else
+ else if (TREE_CODE (body) == STATEMENT_LIST)
{
tree_stmt_iterator i;
- gcc_assert (TREE_CODE (body) == STATEMENT_LIST);
for (i = tsi_start (body); !tsi_end_p (i); tsi_next (&i))
{
ok = build_data_member_initialization (tsi_stmt (i), &vec);
@@ -5518,6 +5517,8 @@ build_constexpr_constructor_member_initializers (tree type, tree body)
break;
}
}
+ else
+ gcc_assert (errorcount > 0);
if (ok)
return build_constructor (type, vec);
else