1999-08-06 Jason Merrill <jason@yorick.cygnus.com>
+ * decl.c (bad_specifiers): It's OK to have an EH spec on a function
+ pointer.
+
+ * pt.c (maybe_get_template_decl_from_type_decl): Make sure that
+ we're looking at a class.
+
* decl.c (lookup_name_real): Set the complain flag if we're
looking for a namespace member.
cp_error ("`const' and `volatile' function specifiers on `%D' invalid in %s declaration",
object, type);
if (friendp)
- cp_error_at ("invalid friend declaration", object);
- if (raises)
- cp_error_at ("invalid exception specifications", object);
+ cp_error_at ("`%D' declared as a friend", object);
+ if (raises && ! TYPE_PTRFN_P (TREE_TYPE (object)))
+ cp_error_at ("`%D' declared with an exception specification", object);
}
/* CTYPE is class type, or null if non-class.
return (decl != NULL_TREE
&& TREE_CODE (decl) == TYPE_DECL
&& DECL_ARTIFICIAL (decl)
+ && CLASS_TYPE_P (decl)
&& CLASSTYPE_TEMPLATE_INFO (TREE_TYPE (decl)))
? CLASSTYPE_TI_TEMPLATE (TREE_TYPE (decl)) : decl;
}
case METHOD_TYPE:
if (! comp_except_specs (TYPE_RAISES_EXCEPTIONS (t1),
- TYPE_RAISES_EXCEPTIONS (t2), 1))
+ TYPE_RAISES_EXCEPTIONS (t2), 1))
return 0;
/* This case is anti-symmetrical!
case FUNCTION_TYPE:
if (! comp_except_specs (TYPE_RAISES_EXCEPTIONS (t1),
- TYPE_RAISES_EXCEPTIONS (t2), 1))
+ TYPE_RAISES_EXCEPTIONS (t2), 1))
return 0;
val = ((TREE_TYPE (t1) == TREE_TYPE (t2)