diff options
author | Paolo Carlini <pcarlini@suse.de> | 2005-03-21 11:49:32 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2005-03-21 11:49:32 +0000 |
commit | 72e4661a2548a1fd0bf227ee81c38363da0e6900 (patch) | |
tree | 9590cde2e6abd351ecf4b43025f91a15d086cdea | |
parent | a16095f6eb4e9f097e828317c9869a67828ec93f (diff) | |
download | gcc-72e4661a2548a1fd0bf227ee81c38363da0e6900.zip gcc-72e4661a2548a1fd0bf227ee81c38363da0e6900.tar.gz gcc-72e4661a2548a1fd0bf227ee81c38363da0e6900.tar.bz2 |
re PR c++/20461 (ICE at "class 'C' does not have any field named 'f'" error)
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).
From-SVN: r96784
-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))) |