From 41dbd8dc1b57d437a32724c89bd0f2568d63b415 Mon Sep 17 00:00:00 2001 From: paolo Date: Mon, 21 Mar 2005 11:49:32 +0000 Subject: [PATCH] 2005-03-21 Paolo Carlini PR c++/20461 PR c++/20536 * init.c (emit_mem_initializers): Don't crash on undefined types. 2005-03-21 Paolo Carlini PR c++/20147 * semantics.c (finish_stmt_expr_expr): Return immediately if error_operand_p (expr). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@96784 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/ChangeLog | 13 +++++++++++++ gcc/cp/init.c | 5 +++++ gcc/cp/semantics.c | 3 +++ 3 files changed, 21 insertions(+) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 76c1305bea69..1f79100a21d9 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,16 @@ +2005-03-21 Paolo Carlini + + PR c++/20461 + PR c++/20536 + * init.c (emit_mem_initializers): Don't crash on undefined + types. + +2005-03-21 Paolo Carlini + + PR c++/20147 + * semantics.c (finish_stmt_expr_expr): Return immediately + if error_operand_p (expr). + 2005-03-21 Joseph S. Myers * cp-tree.h (lvalue_or_else, lvalue_p): New. diff --git a/gcc/cp/init.c b/gcc/cp/init.c index c526bb14511b..ddf39bfd6900 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 15762cb78831..f0dc8c2f7d61 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))) -- 2.47.3