diff options
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r-- | gcc/cp/decl.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index c054bfb..5677781 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -4271,8 +4271,11 @@ reshape_init (tree type, tree *initp) empty class shall have the form of an empty initializer-list {}. */ if (!brace_enclosed_p) - error ("initializer for `%T' must be brace-enclosed", - type); + { + error ("initializer for `%T' must be brace-enclosed", + type); + return error_mark_node; + } } else { @@ -4297,6 +4300,8 @@ reshape_init (tree type, tree *initp) break; field_init = reshape_init (TREE_TYPE (field), initp); + if (field_init == error_mark_node) + return error_mark_node; TREE_CHAIN (field_init) = CONSTRUCTOR_ELTS (new_init); CONSTRUCTOR_ELTS (new_init) = field_init; /* [dcl.init.aggr] @@ -4327,6 +4332,8 @@ reshape_init (tree type, tree *initp) tree element_init; element_init = reshape_init (TREE_TYPE (type), initp); + if (element_init == error_mark_node) + return error_mark_node; TREE_CHAIN (element_init) = CONSTRUCTOR_ELTS (new_init); CONSTRUCTOR_ELTS (new_init) = element_init; if (TREE_PURPOSE (element_init)) |