method_name_cmp);
}
-/* Emit error when a duplicate definition of a type is seen. Patch up. */
-
-void
-duplicate_tag_error (tree t)
-{
- error ("redefinition of `%#T'", t);
- cp_error_at ("previous definition of `%#T'", t);
-
- /* Pretend we haven't defined this type. */
-
- /* All of the component_decl's were TREE_CHAINed together in the parser.
- finish_struct_methods walks these chains and assembles all methods with
- the same base name into DECL_CHAINs. Now we don't need the parser chains
- anymore, so we unravel them. */
-
- /* This used to be in finish_struct, but it turns out that the
- TREE_CHAIN is used by dbxout_type_methods and perhaps some other
- things... */
- if (CLASSTYPE_METHOD_VEC (t))
- {
- tree method_vec = CLASSTYPE_METHOD_VEC (t);
- int i, len = TREE_VEC_LENGTH (method_vec);
- for (i = 0; i < len; i++)
- {
- tree unchain = TREE_VEC_ELT (method_vec, i);
- while (unchain != NULL_TREE)
- {
- TREE_CHAIN (OVL_CURRENT (unchain)) = NULL_TREE;
- unchain = OVL_NEXT (unchain);
- }
- }
- }
-
- if (TYPE_LANG_SPECIFIC (t))
- {
- tree binfo = TYPE_BINFO (t);
- int interface_only = CLASSTYPE_INTERFACE_ONLY (t);
- int interface_unknown = CLASSTYPE_INTERFACE_UNKNOWN (t);
- tree template_info = CLASSTYPE_TEMPLATE_INFO (t);
- int use_template = CLASSTYPE_USE_TEMPLATE (t);
-
- memset ((char *) TYPE_LANG_SPECIFIC (t), 0, sizeof (struct lang_type));
- BINFO_BASETYPES(binfo) = NULL_TREE;
-
- TYPE_LANG_SPECIFIC (t)->u.h.is_lang_type_class = 1;
- TYPE_BINFO (t) = binfo;
- CLASSTYPE_INTERFACE_ONLY (t) = interface_only;
- SET_CLASSTYPE_INTERFACE_UNKNOWN_X (t, interface_unknown);
- TYPE_REDEFINED (t) = 1;
- CLASSTYPE_TEMPLATE_INFO (t) = template_info;
- CLASSTYPE_USE_TEMPLATE (t) = use_template;
- CLASSTYPE_DECL_LIST (t) = NULL_TREE;
- }
- TYPE_SIZE (t) = NULL_TREE;
- TYPE_MODE (t) = VOIDmode;
- TYPE_FIELDS (t) = NULL_TREE;
- TYPE_METHODS (t) = NULL_TREE;
- TYPE_VFIELD (t) = NULL_TREE;
- TYPE_CONTEXT (t) = NULL_TREE;
-
- /* Clear TYPE_LANG_FLAGS -- those in TYPE_LANG_SPECIFIC are cleared above. */
- TYPE_LANG_FLAG_0 (t) = 0;
- TYPE_LANG_FLAG_1 (t) = 0;
- TYPE_LANG_FLAG_2 (t) = 0;
- TYPE_LANG_FLAG_3 (t) = 0;
- TYPE_LANG_FLAG_4 (t) = 0;
- TYPE_LANG_FLAG_5 (t) = 0;
- TYPE_LANG_FLAG_6 (t) = 0;
- /* But not this one. */
- SET_IS_AGGR_TYPE (t, 1);
-}
-
/* Make BINFO's vtable have N entries, including RTTI entries,
vbase and vcall offsets, etc. Set its type and call the backend
to lay it out. */