summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsje <sje@138bc75d-0d04-0410-961f-82ee72b054a4>2006-06-23 21:53:36 +0000
committersje <sje@138bc75d-0d04-0410-961f-82ee72b054a4>2006-06-23 21:53:36 +0000
commitb81452c985a503c959c05b37b2949f273cb4dcc1 (patch)
tree183a1afe70a9ef162076602664dc56f17385ea4f
parente5d0ba064e4b160d9a8821adbabbab2ef44da7c2 (diff)
downloadppe42-gcc-b81452c985a503c959c05b37b2949f273cb4dcc1.tar.gz
ppe42-gcc-b81452c985a503c959c05b37b2949f273cb4dcc1.zip
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
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/typeck2.c10
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 <sje@cup.hp.com>
+
+ PR c++/27019
+ * typeck2.c (process_init_constructor_array): Set ce->value on errors.
+
2006-06-23 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
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);
OpenPOWER on IntegriCloud