From 77bffd4cee22d47afd683172ad0a91e4c4cd4990 Mon Sep 17 00:00:00 2001 From: Steve Ellcey Date: Mon, 17 Jul 2006 15:28:17 +0000 Subject: [PATCH] re PR c++/28291 (ICE on invalid designated initializer) PR c++/28291 * decl.c (reshape_init_class): Return error_mark_node on error. From-SVN: r115523 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/decl.c | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 4741d4a996c..ebbbb6219f7 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2006-07-17 Steve Ellcey + + PR c++/28291 + * decl.c (reshape_init_class): Return error_mark_node on error. + 2006-07-17 Steve Ellcey PR c++/28304 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index b74a1a9bac6..dd0e7e3e892 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -4505,8 +4505,11 @@ reshape_init_class (tree type, reshape_iter *d, bool first_initializer_p) field = lookup_field_1 (type, d->cur->index, /*want_type=*/false); if (!field || TREE_CODE (field) != FIELD_DECL) - error ("%qT has no non-static data member named %qD", type, - d->cur->index); + { + error ("%qT has no non-static data member named %qD", type, + d->cur->index); + return error_mark_node; + } } /* If we processed all the member of the class, we are done. */