aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog8
-rw-r--r--gcc/cp/decl.c11
2 files changed, 17 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 3e6d1b2..fd63165 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2003-12-16 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/12696
+ * decl.c (reshape_init): Recover quickly from errors.
+
2003-12-16 Nathan Sidwell <nathan@codesourcery.com>
PR c++/9043
@@ -9,6 +14,9 @@
2003-12-16 Mark Mitchell <mark@codesourcery.com>
+ PR c++/12696
+ * decl.c (reshape_init): Recover quickly from errors.
+
PR c++/13275
* lex.c (reswords): Add "__offsetof" and "__offsetof__".
* parser.c (cp_parser): Add in_offsetof_p.
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))