From da0f17e241d30a4f2d192c84d804081c5b133e18 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Wed, 28 Oct 1998 20:36:04 +0000 Subject: [PATCH] class.c (finish_struct_1): Don't complain about non-copy assignment ops in union members. * class.c (finish_struct_1): Don't complain about non-copy assignment ops in union members. * class.c (build_vtable): Don't pass at_eof to import_export_vtable. (prepare_fresh_vtable): Likewise. (finish_struct_1): Don't call import_export_class. * decl2.c (finish_vtable_vardecl): Do import/export stuff. (finish_prevtable_vardecl): Lose. (finish_file): Don't call it. * pt.c (instantiate_class_template): Likewise. From-SVN: r23411 --- gcc/cp/ChangeLog | 13 +++++++++++++ gcc/cp/class.c | 13 ++++--------- gcc/cp/decl2.c | 17 +++-------------- gcc/cp/pt.c | 2 -- 4 files changed, 20 insertions(+), 25 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 8b0faa7ad8c5..24a746d21e29 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,16 @@ +1998-10-28 Jason Merrill + + * class.c (finish_struct_1): Don't complain about non-copy + assignment ops in union members. + + * class.c (build_vtable): Don't pass at_eof to import_export_vtable. + (prepare_fresh_vtable): Likewise. + (finish_struct_1): Don't call import_export_class. + * decl2.c (finish_vtable_vardecl): Do import/export stuff. + (finish_prevtable_vardecl): Lose. + (finish_file): Don't call it. + * pt.c (instantiate_class_template): Likewise. + 1998-10-23 Martin von Löwis * parse.y (condition): Convert VAR_DECL from reference to indirect diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 07092c76f104..b9874d04a9a1 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -704,7 +704,7 @@ build_vtable (binfo, type) #endif /* Set TREE_PUBLIC and TREE_EXTERN as appropriate. */ - import_export_vtable (decl, type, at_eof); + import_export_vtable (decl, type, 0); decl = pushdecl_top_level (decl); SET_IDENTIFIER_GLOBAL_VALUE (name, decl); @@ -890,7 +890,7 @@ prepare_fresh_vtable (binfo, for_type) #endif /* Set TREE_PUBLIC and TREE_EXTERN as appropriate. */ - import_export_vtable (new_decl, for_type, at_eof); + import_export_vtable (new_decl, for_type, 0); if (TREE_VIA_VIRTUAL (binfo)) my_friendly_assert (binfo == binfo_member (BINFO_TYPE (binfo), @@ -3547,8 +3547,8 @@ finish_struct_1 (t, warn_anon) fie = "constructor"; else if (TYPE_NEEDS_DESTRUCTOR (type)) fie = "destructor"; - else if (TYPE_HAS_REAL_ASSIGNMENT (type)) - fie = "assignment operator"; + else if (TYPE_HAS_COMPLEX_ASSIGN_REF (type)) + fie = "copy assignment operator"; if (fie) cp_error_at ("member `%#D' with %s not allowed in union", x, fie); @@ -3943,11 +3943,6 @@ finish_struct_1 (t, warn_anon) if (max_has_virtual > 0) TYPE_VIRTUAL_P (t) = 1; - /* Do this here before we start messing with vtables so that we are ready - for import_export_vtable. */ - if (at_eof) - import_export_class (t); - if (flag_rtti && TYPE_VIRTUAL_P (t) && !pending_hard_virtuals) modify_all_vtables (t, NULL_TREE, NULL_TREE); diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 2df2ac0d5c11..e9a65a059e11 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -2649,20 +2649,14 @@ import_export_class (ctype) } } -int -finish_prevtable_vardecl (prev, vars) +static int +finish_vtable_vardecl (prev, vars) tree prev, vars; { tree ctype = DECL_CONTEXT (vars); import_export_class (ctype); import_export_vtable (vars, ctype, 1); - return 1; -} - -static int -finish_vtable_vardecl (prev, vars) - tree prev, vars; -{ + if (write_virtuals >= 0 && ! DECL_EXTERNAL (vars) && ((TREE_PUBLIC (vars) && ! DECL_WEAK (vars) && ! DECL_ONE_ONLY (vars)) @@ -3217,11 +3211,6 @@ finish_file () pushdecl (vars); #endif - /* Walk to mark the inline functions we need, then output them so - that we can pick up any other tdecls that those routines need. */ - walk_vtables ((void (*) PROTO ((tree, tree))) 0, - finish_prevtable_vardecl); - for (vars = static_aggregates; vars; vars = TREE_CHAIN (vars)) if (! TREE_ASM_WRITTEN (TREE_VALUE (vars))) rest_of_decl_compilation (TREE_VALUE (vars), 0, 1, 1); diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 5c65140cbe7b..556b761831a4 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -4078,8 +4078,6 @@ instantiate_class_template (type) CLASSTYPE_GOT_SEMICOLON (type) = 1; repo_template_used (type); - if (at_eof && TYPE_BINFO_VTABLE (type) != NULL_TREE) - finish_prevtable_vardecl (NULL, TYPE_BINFO_VTABLE (type)); end: TYPE_BEING_DEFINED (type) = 0; -- 2.47.2