diff options
author | Jason Merrill <jason@yorick.cygnus.com> | 1999-08-07 01:22:26 +0000 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 1999-08-06 21:22:26 -0400 |
commit | f8e55f34658519d892a5e0b7801b7bf029a41b23 (patch) | |
tree | 5f55028157f56dee24cd6a6252b01f77f36f5127 /gcc | |
parent | adace600117e4a5bf1ac34d13c473284fe9c768b (diff) | |
download | gcc-f8e55f34658519d892a5e0b7801b7bf029a41b23.zip gcc-f8e55f34658519d892a5e0b7801b7bf029a41b23.tar.gz gcc-f8e55f34658519d892a5e0b7801b7bf029a41b23.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/decl.c | 6 | ||||
-rw-r--r-- | gcc/cp/pt.c | 1 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 4 |
4 files changed, 12 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index a9e045b..2840d962 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,11 @@ 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. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 038b099..b3f534b 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -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. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 357b1d1..bab7634 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -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; } diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index a4d6573..fd17b11 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -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) |