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: r23410
This commit is contained in:
Jason Merrill 1998-10-28 20:29:09 +00:00 committed by Jason Merrill
parent 5916476fda
commit 2455f26fc1
5 changed files with 19 additions and 27 deletions

View File

@ -1,5 +1,16 @@
1998-10-28 Jason Merrill <jason@yorick.cygnus.com>
* 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.
* init.c (build_delete): Reset TYPE_HAS_DESTRUCTOR here.
* decl.c (finish_function): Not here.
(start_function): Do set DECL_INITIAL.

View File

@ -717,7 +717,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);
@ -901,7 +901,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),
@ -3703,8 +3703,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);
@ -4043,11 +4043,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);

View File

@ -2686,7 +2686,6 @@ extern tree coerce_delete_type PROTO((tree));
extern void comdat_linkage PROTO((tree));
extern void import_export_class PROTO((tree));
extern void import_export_vtable PROTO((tree, tree, int));
extern int finish_prevtable_vardecl PROTO((tree, tree));
extern int walk_vtables PROTO((void (*)(tree, tree),
int (*)(tree, tree)));
extern void walk_sigtables PROTO((void (*)(tree, tree),

View File

@ -2578,16 +2578,6 @@ import_export_class (ctype)
}
}
int
finish_prevtable_vardecl (prev, vars)
tree prev ATTRIBUTE_UNUSED, vars;
{
tree ctype = DECL_CONTEXT (vars);
import_export_class (ctype);
import_export_vtable (vars, ctype, 1);
return 1;
}
/* We need to describe to the assembler the relationship between
a vtable and the vtable of the parent class. */
@ -2619,6 +2609,10 @@ 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);
if (! DECL_EXTERNAL (vars)
&& (DECL_INTERFACE_KNOWN (vars)
|| TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (vars))
@ -3352,11 +3346,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);

View File

@ -4736,8 +4736,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;