Commit f8e55f34 by Jason Merrill Committed by Jason Merrill

decl.c (bad_specifiers): It's OK to have an EH spec on a function pointer.

	* 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.

From-SVN: r28562
parent adace600
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.
......
......@@ -8362,9 +8362,9 @@ bad_specifiers (object, type, virtualp, quals, inlinep, friendp, raises)
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.
......
......@@ -3616,6 +3616,7 @@ maybe_get_template_decl_from_type_decl (decl)
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;
}
......
......@@ -1122,7 +1122,7 @@ comptypes (t1, t2, strict)
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!
......@@ -1150,7 +1150,7 @@ comptypes (t1, t2, strict)
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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment