+1999-02-13 Jason Merrill <jason@yorick.cygnus.com>
+
+ * decl.c (grokfndecl): Return NULL_TREE instead of error_mark_node.
+ (grokdeclarator): Don't expect error_mark_node from grokfndecl.
+
+ * pt.c (maybe_process_partial_specialization): Complain about
+ 'template <>' on non-specialization.
+
1999-02-10 Jason Merrill <jason@yorick.cygnus.com>
* decl.c (grokdeclarator): Catch wierd declarators.
CHECK is 1 if we must find this method in CTYPE, 0 if we should
not look, and -1 if we should not call `grokclassfn' at all.
- Returns `error_mark_node' if something goes wrong, after issuing
+ Returns `NULL_TREE' if something goes wrong, after issuing
applicable error messages. */
static tree
/* Something like `template <class T> friend void f<T>()'. */
cp_error ("template-id `%D' in declaration of primary template",
orig_declarator);
- return error_mark_node;
+ return NULL_TREE;
}
/* A friend declaration of the form friend void f<>(). Record
2 * (funcdef_flag != 0) +
4 * (friendp != 0));
if (decl == error_mark_node)
- return error_mark_node;
+ return NULL_TREE;
if ((! TYPE_FOR_JAVA (ctype) || check_java_method (decl))
&& check)
return tmp;
}
if (! grok_ctor_properties (ctype, decl))
- return error_mark_node;
+ return NULL_TREE;
}
else
{
2 * (funcdef_flag != 0) +
4 * (friendp != 0));
if (decl == error_mark_node)
- return error_mark_node;
+ return NULL_TREE;
if (ctype != NULL_TREE
&& (! TYPE_FOR_JAVA (ctype) || check_java_method (decl))
virtualp, flags, quals, raises, attrlist,
friendp ? -1 : 0, friendp, publicp, inlinep,
funcdef_flag, template_count, in_namespace);
- if (decl == NULL_TREE || decl == error_mark_node)
+ if (decl == NULL_TREE)
return decl;
#if 0
/* This clobbers the attrs stored in `decl' from `attrlist'. */
if (decl == NULL_TREE)
return NULL_TREE;
- /* Among other times, could occur from check_explicit_specialization
- returning an error_mark_node. */
- if (decl == error_mark_node)
- return error_mark_node;
-
if (staticp == 1)
{
int illegal_static = 0;
else if (CLASSTYPE_TEMPLATE_INSTANTIATION (type))
cp_error ("specialization of `%T' after instantiation", type);
}
+ else if (processing_specialization)
+ cp_error ("explicit specialization of non-template `%T'", type);
}
/* Retrieve the specialization (in the sense of [temp.spec] - a