summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2001-10-16 13:01:44 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2001-10-16 13:01:44 +0000
commita49facc5bec86f6157a09853b51fc05f8e220f65 (patch)
tree3554c26c52d8af25ab1b5e18ea055ea714e13376
parentd1851e43a58a47e415e0924e6f16e95b7634cd35 (diff)
downloadgcc-a49facc5bec86f6157a09853b51fc05f8e220f65.tar.gz
* decl.c (bad_specifiers): Don't allow exception specifications
on any typedefs. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46285 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/decl.c6
2 files changed, 9 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 46761953430..f5a999286d6 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 60cceada0f7..e499cdbfabe 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);
}