diff options
Diffstat (limited to 'gcc/cp/typeck2.c')
-rw-r--r-- | gcc/cp/typeck2.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c index f4de802c17d..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); @@ -1200,7 +1206,7 @@ build_m_component_ref (tree datum, tree component) tree binfo; tree ctype; - if (datum == error_mark_node || component == error_mark_node) + if (error_operand_p (datum) || error_operand_p (component)) return error_mark_node; ptrmem_type = TREE_TYPE (component); |