From b81452c985a503c959c05b37b2949f273cb4dcc1 Mon Sep 17 00:00:00 2001 From: sje Date: Fri, 23 Jun 2006 21:53:36 +0000 Subject: [PATCH] PR c++/27019 * typeck2.c (process_init_constructor_array): Set ce->value on errors. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@114952 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/typeck2.c | 10 ++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 76ed3a0abba..178b0af9cea 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2006-06-23 Steve Ellcey + + PR c++/27019 + * typeck2.c (process_init_constructor_array): Set ce->value on errors. + 2006-06-23 Volker Reichelt PR c++/28112 diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c index 6ad4e8347aa..bef448bbdf9 100644 --- a/gcc/cp/typeck2.c +++ b/gcc/cp/typeck2.c @@ -797,7 +797,10 @@ process_init_constructor_array (tree type, tree init) { gcc_assert (TREE_CODE (ce->index) == INTEGER_CST); if (compare_tree_int (ce->index, i) != 0) - sorry ("non-trivial designated initializers not supported"); + { + ce->value = error_mark_node; + sorry ("non-trivial designated initializers not supported"); + } } else ce->index = size_int (i); @@ -895,7 +898,10 @@ process_init_constructor_record (tree type, tree init) || TREE_CODE (ce->index) == IDENTIFIER_NODE); if (ce->index != field && ce->index != DECL_NAME (field)) - sorry ("non-trivial designated initializers not supported"); + { + ce->value = error_mark_node; + sorry ("non-trivial designated initializers not supported"); + } } gcc_assert (ce->value); -- 2.11.4.GIT