+1999-07-09 Jason Merrill <jason@yorick.cygnus.com>
+
+ * pt.c (do_decl_instantiation): Downgrade duplicate instantiation
+ errors to pedwarn.
+
+1999-07-09 Michael Tiemann <tiemann@happy.cygnus.com>
+
+ * typeck.c (comptypes): Simplify C code in look_hard.
+
+ * xref.c (PALLOC): Use xcalloc, not calloc.
+ (SALLOC): Use xmalloc, not malloc.
+
+ * rtti.c (synthesize_tinfo_fn): Add missing call to pop_momentary.
+
+ * search.c (note_debug_info_needed): Don't search if WRITE_SYMBOLS
+ is NO_DEBUG.
+
+ * decl.c (duplicate_decls): If a redeclaration doesn't match the
+ initial declaration, then don't save the inline info and by all
+ means don't mark the function as a builtin function.
+
+ * decl.c (lookup_name_real): Set NONCLASS to 1 if
+ CURRENT_CLASS_TYPE is 0.
+
+ * class.c (duplicate_tag_error): Set TYPE_NONCOPIED_PARTS to
+ NULL_TREE.
+
Wed Jul 7 01:26:47 1999 Alexandre Oliva <oliva@dcc.unicamp.br>
* decl2.c (mark_vtable_entries): Fix check for rtti offset.
TYPE_METHODS (t) = NULL_TREE;
TYPE_VFIELD (t) = NULL_TREE;
TYPE_CONTEXT (t) = NULL_TREE;
+ TYPE_NONCOPIED_PARTS (t) = NULL_TREE;
}
/* finish up all new vtables. */
{
finish_struct_methods (t);
TYPE_SIZE (t) = integer_zero_node;
- }
+ }
else
finish_struct_1 (t, warn_anon);
}
if (! types_match || new_defines_function)
{
- /* These need to be copied so that the names are available. */
+ /* These need to be copied so that the names are available.
+ Note that if the types do match, we'll preserve inline
+ info and other bits, but if not, we won't. */
DECL_ARGUMENTS (olddecl) = DECL_ARGUMENTS (newdecl);
DECL_RESULT (olddecl) = DECL_RESULT (newdecl);
}
/* If defining a function declared with other language
linkage, use the previously declared language linkage. */
DECL_LANGUAGE (newdecl) = DECL_LANGUAGE (olddecl);
- else
+ else if (types_match)
{
/* If redeclaring a builtin function, and not a definition,
it stays built in. */
}
/* First, look in non-namespace scopes. */
+
+ if (current_class_type == NULL_TREE)
+ nonclass = 1;
+
for (t = IDENTIFIER_BINDING (name); t; t = TREE_CHAIN (t))
{
tree binding;
}
/* Check that all fields are properly initialized after
- an assignment to `this'. */
+ an assignment to `this'. Called only when such an assignment
+ is actually noted. */
void
check_base_init (t)
No program shall both explicitly instantiate and explicitly
specialize a template. */
- cp_error ("explicit instantiation of `%#D' after", result);
- cp_error_at ("explicit specialization here", result);
+ cp_pedwarn ("explicit instantiation of `%#D' after", result);
+ cp_pedwarn_at ("explicit specialization here", result);
return;
}
else if (DECL_EXPLICIT_INSTANTIATION (result))
first instantiation was `extern' and the second is not, and
EXTERN_P for the opposite case. */
if (DECL_INTERFACE_KNOWN (result) && !extern_p)
- cp_error ("duplicate explicit instantiation of `%#D'", result);
+ cp_pedwarn ("duplicate explicit instantiation of `%#D'", result);
/* If we've already instantiated the template, just return now. */
if (DECL_INTERFACE_KNOWN (result))
fprintf (file, " interface-only");
if (CLASSTYPE_INTERFACE_UNKNOWN (node))
fprintf (file, " interface-unknown");
+ if (CLASSTYPE_VTABLE_NEEDS_WRITING (node))
+ fprintf (file, " vtable-needs-writing");
print_node (file, "member-functions", CLASSTYPE_METHOD_VEC (node),
indent + 4);
}
tmp = cp_convert (build_pointer_type (type_info_type_node), addr);
tmp = build_indirect_ref (tmp, 0);
c_expand_return (tmp);
+ pop_momentary ();
finish_function (lineno, 0, 0);
}
could, but that would mean putting global labels in the debug output
before each exported type and each of its functions and static data
members. */
- if (write_symbols == DWARF_DEBUG || write_symbols == DWARF2_DEBUG)
+ if (write_symbols == DWARF_DEBUG || write_symbols == DWARF2_DEBUG
+ || write_symbols == NO_DEBUG)
return;
dfs_walk (TYPE_BINFO (type), dfs_debug_mark, dfs_debug_unmarkedp, 0);
TYPE_TI_ARGS (t2));
look_hard:
if ((strict & COMPARE_BASE) && DERIVED_FROM_P (t1, t2))
- {
- val = 1;
- break;
- }
- if ((strict & COMPARE_RELAXED) && DERIVED_FROM_P (t2, t1))
- {
- val = 1;
- break;
- }
+ val = 1;
+ else if ((strict & COMPARE_RELAXED) && DERIVED_FROM_P (t2, t1))
+ val = 1;
break;
case OFFSET_TYPE:
#define FALSE 0
#endif
-#define PALLOC(typ) ((typ *) calloc(1,sizeof(typ)))
+#define PALLOC(typ) ((typ *) xcalloc(1,sizeof(typ)))
/* Return a malloc'd copy of STR. */
#define SALLOC(str) \
((char *) ((str) == NULL ? NULL \
- : (char *) strcpy ((char *) malloc (strlen ((str)) + 1), (str))))
+ : (char *) strcpy ((char *) xmalloc (strlen ((str)) + 1), (str))))
#define SFREE(str) (str != NULL && (free(str),0))
#define STREQL(s1,s2) (strcmp((s1),(s2)) == 0)