From 170b020fe4be4eadea27d389257778d952fb5a13 Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Fri, 20 Jun 2003 00:48:44 +0000 Subject: re PR middle-end/11041 (ICE: const myclass &x = *x; (when operator*() defined)) PR c++/11041 * call.c (initialize_reference): Do not use cp_finish_decl to emit temporary variables. * cp-tree.h (static_aggregates): Declare. (pushdecl_top_level_and_finish): Likewise. * decl.c (pushdecl_top_level_1): New function. (pushdecl_top_level): Use it. (pushdecl_top_level_and_finish): New function. (initialize_local_var): Remove redundant code. (cp_finish_decl): Remove support for RESULT_DECLs. Don't check building_stmt_tree. * decl.h (static_aggregates): Remove. * decl2.c (get_guard): Use pushdecl_top_level_and_finish. * rtti.c (get_tinfo_decl): Use pushdecl_top_level_and_finish. (tinfo_base_init): Likewise. PR c++/11041 * g++.dg/init/ref7.C: New test. From-SVN: r68236 --- gcc/cp/rtti.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'gcc/cp/rtti.c') diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c index ac117fa..1a29c1c 100644 --- a/gcc/cp/rtti.c +++ b/gcc/cp/rtti.c @@ -364,9 +364,8 @@ get_tinfo_decl (tree type) DECL_EXTERNAL (d) = 1; SET_DECL_ASSEMBLER_NAME (d, name); DECL_COMDAT (d) = 1; - cp_finish_decl (d, NULL_TREE, NULL_TREE, 0); - pushdecl_top_level (d); + pushdecl_top_level_and_finish (d, NULL_TREE); if (CLASS_TYPE_P (type)) CLASSTYPE_TYPEINFO_VAR (TYPE_MAIN_VARIANT (type)) = d; @@ -770,8 +769,7 @@ tinfo_base_init (tree desc, tree target) SET_DECL_ASSEMBLER_NAME (name_decl, mangle_typeinfo_string_for_type (target)); DECL_INITIAL (name_decl) = name_string; - cp_finish_decl (name_decl, name_string, NULL_TREE, 0); - pushdecl_top_level (name_decl); + pushdecl_top_level_and_finish (name_decl, name_string); } vtable_ptr = TINFO_VTABLE_DECL (desc); -- cgit v1.1