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.
#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);
#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),
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);
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);
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),
}
}
-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. */
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))
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);
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;