diff options
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 13 | ||||
-rw-r--r-- | gcc/cp/init.c | 5 | ||||
-rw-r--r-- | gcc/cp/semantics.c | 3 |
3 files changed, 21 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 76c1305..1f79100 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,16 @@ +2005-03-21 Paolo Carlini <pcarlini@suse.de> + + PR c++/20461 + PR c++/20536 + * init.c (emit_mem_initializers): Don't crash on undefined + types. + +2005-03-21 Paolo Carlini <pcarlini@suse.de> + + PR c++/20147 + * semantics.c (finish_stmt_expr_expr): Return immediately + if error_operand_p (expr). + 2005-03-21 Joseph S. Myers <joseph@codesourcery.com> * cp-tree.h (lvalue_or_else, lvalue_p): New. diff --git a/gcc/cp/init.c b/gcc/cp/init.c index c526bb1..ddf39bf 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -655,6 +655,11 @@ sort_mem_initializers (tree t, tree mem_inits) void emit_mem_initializers (tree mem_inits) { + /* We will already have issued an error message about the fact that + the type is incomplete. */ + if (!COMPLETE_TYPE_P (current_class_type)) + return; + /* Sort the mem-initializers into the order in which the initializations should be performed. */ mem_inits = sort_mem_initializers (current_class_type, mem_inits); diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 15762cb..f0dc8c2 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -1523,6 +1523,9 @@ finish_stmt_expr_expr (tree expr, tree stmt_expr) { tree result = NULL_TREE; + if (error_operand_p (expr)) + return error_mark_node; + if (expr) { if (!processing_template_decl && !VOID_TYPE_P (TREE_TYPE (expr))) |