+Fri Mar 22 13:48:29 1996 Jason Merrill <jason@yorick.cygnus.com>
+
+ * pt.c (tsubst, case TYPE_DECL): Set DECL_CONTEXT.
+
+ * typeck.c (require_complete_type): Be sure to instantiate the
+ MAIN_VARIANT of the type.
+
+ * decl2.c (finish_file): Instantiate pending templates before
+ processing static constructors and destructors.
+
+ * pt.c (instantiate_decl): Don't instantiate functions at toplevel
+ unless at_eof.
+
+Fri Mar 22 09:30:17 1996 Bob Manson <manson@beauty.cygnus.com>
+
+ * decl2.c (delete_sanity): If error_mark_node is passed
+ in as an expression, quit while we're ahead.
+
+ * decl.c (grokdeclarator): Give an error message if `friend'
+ is combined with any storage class specifiers.
+
Wed Mar 20 14:51:55 1996 Jason Merrill <jason@yorick.cygnus.com>
* parse.y (named_complex_class_head_sans_basetype): Don't crash on
error ("top-level declaration of `%s' specifies `auto'", name);
}
+ if (nclasses > 0 && friendp)
+ error ("storage class specifiers invalid in friend function declarations");
+
/* Now figure out the structure of the declarator proper.
Descend through it, creating more complex types, until we reach
the declared identifier (or NULL_TREE, in an absolute declarator). */
this down as a NULL_TREE into build_vec_delete. */
tree maxindex = NULL_TREE;
+ if (exp == error_mark_node)
+ return exp;
+
if (current_template_parms)
{
t = build_min (DELETE_EXPR, void_type_node, exp, size);
start_time = get_run_time ();
- /* Push into C language context, because that's all
- we'll need here. */
- push_lang_context (lang_name_c);
-
/* Otherwise, GDB can get confused, because in only knows
about source for LINENO-1 lines. */
lineno -= 1;
interface_unknown = 1;
interface_only = 0;
+ for (fnname = pending_templates; fnname; fnname = TREE_CHAIN (fnname))
+ {
+ tree decl = TREE_VALUE (fnname);
+ instantiate_decl (decl);
+ }
+
+ /* Push into C language context, because that's all
+ we'll need here. */
+ push_lang_context (lang_name_c);
+
#if 1
/* The reason for pushing garbage onto the global_binding_level is to
ensure that we can slice out _DECLs which pertain to virtual function
if (flag_handle_signatures)
walk_sigtables ((void (*)())0, finish_sigtable_vardecl);
- for (fnname = pending_templates; fnname; fnname = TREE_CHAIN (fnname))
- {
- tree decl = TREE_VALUE (fnname);
- instantiate_decl (decl);
- }
for (fnname = saved_inlines; fnname; fnname = TREE_CHAIN (fnname))
{
tree decl = TREE_VALUE (fnname);
Only exact type matching or reference matching of throw types works when
-fno-rtti is used. Only works on a SPARC (like Suns), i386, arm,
-rs6000, PowerPC, Alpha, mips, VAX, and m68k machines. Partial support
+rs6000, PowerPC, Alpha, mips, VAX, m68k and z8k machines. Partial support
is in for all other machines, but a stack unwinder called
__unwind_function has to be written, and added to libgcc2 for them. The
new EH code doesn't rely upon the __unwind_function for C++ code,
{
tree r = copy_node (t);
TREE_TYPE (r) = type;
+ DECL_CONTEXT (r) = current_class_type;
set_nested_typename (r, current_class_name, DECL_NAME (r), type);
TREE_CHAIN (r) = NULL_TREE;
return r;
if (! pattern_defined
|| (TREE_CODE (d) == FUNCTION_DECL && ! DECL_INLINE (d)
&& (! DECL_INTERFACE_KNOWN (d)
- || ! DECL_NOT_REALLY_EXTERN (d))))
+ || ! DECL_NOT_REALLY_EXTERN (d)))
+ /* Kludge: if we compile a constructor in the middle of processing a
+ toplevel declaration, we blow away the declspecs in
+ temp_decl_obstack when we call permanent_allocation in
+ finish_function. So don't compile it yet. */
+ || (TREE_CODE (d) == FUNCTION_DECL && ! nested && ! at_eof))
{
add_pending_template (d);
return d;
if (IS_AGGR_TYPE (type) && CLASSTYPE_TEMPLATE_INSTANTIATION (type))
{
- instantiate_class_template (type);
+ instantiate_class_template (TYPE_MAIN_VARIANT (type));
if (TYPE_SIZE (type) != 0)
return value;
}