diff options
author | Richard Sandiford <rsandifo@redhat.com> | 2001-10-16 13:01:44 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2001-10-16 13:01:44 +0000 |
commit | e1be26f4f20c5b1d0ba05c7bd354a2513886e4ba (patch) | |
tree | 3554c26c52d8af25ab1b5e18ea055ea714e13376 | |
parent | 5b0b42ed61f8ad9c2105e8dfab833a08fd252c06 (diff) | |
download | gcc-e1be26f4f20c5b1d0ba05c7bd354a2513886e4ba.zip gcc-e1be26f4f20c5b1d0ba05c7bd354a2513886e4ba.tar.gz gcc-e1be26f4f20c5b1d0ba05c7bd354a2513886e4ba.tar.bz2 |
decl.c (bad_specifiers): Don't allow exception specifications on any typedefs.
* decl.c (bad_specifiers): Don't allow exception specifications
on any typedefs.
From-SVN: r46285
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/decl.c | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 4676195..f5a9992 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2001-10-15 Richard Sandiford <rsandifo@redhat.com> + + * decl.c (bad_specifiers): Don't allow exception specifications + on any typedefs. + 2001-10-14 Neil Booth <neil@daikokuya.demon.co.uk> * cp/lex.c (init_cp_pragma): Similarly. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 60ccead..e499cdb 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -8643,8 +8643,10 @@ bad_specifiers (object, type, virtualp, quals, inlinep, friendp, raises) object, type); if (friendp) cp_error_at ("`%D' declared as a friend", object); - if (raises && !TYPE_PTRFN_P (TREE_TYPE (object)) - && !TYPE_PTRMEMFUNC_P (TREE_TYPE (object))) + if (raises + && (TREE_CODE (object) == TYPE_DECL + || (!TYPE_PTRFN_P (TREE_TYPE (object)) + && !TYPE_PTRMEMFUNC_P (TREE_TYPE (object))))) cp_error_at ("`%D' declared with an exception specification", object); } |