aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Mitchell <mark@markmitchell.com>1998-12-22 10:33:17 +0000
committerMark Mitchell <mark@markmitchell.com>1998-12-22 10:33:17 +0000
commit4fcedb191b3b8accdc8e986446a07ec035b61aed (patch)
tree0c8fc83b6aadea1bf733e54f4d68791a1998905b
parentffbcf67f43c8c6291eba4b52f55fafa8e8bc2780 (diff)
1998-12-22 Mark Mitchell <mark@markmitchell.com>
* cp-tree.h (TYPE_RAISES_EXCEPTIONS): Improve documentation. * tree.c (build_exception_variant): Don't crash on empty throw specs. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@24394 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/cp-tree.h4
-rw-r--r--gcc/cp/tree.c4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.eh/spec5.C3
4 files changed, 15 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index ca7bc01683d..e4b724c7607 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+1998-12-22 Mark Mitchell <mark@markmitchell.com>
+
+ * cp-tree.h (TYPE_RAISES_EXCEPTIONS): Improve documentation.
+ * tree.c (build_exception_variant): Don't crash on empty throw
+ specs.
+
1998-12-18 DJ Delorie <dj@cygnus.com>
* cvt.c (convert_to_reference): Check for both error_mark_node
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index cb55b0635da..f4399e7be52 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -1143,7 +1143,9 @@ struct lang_type
#define TREE_PARMLIST(NODE) ((NODE)->common.unsigned_flag) /* overloaded! */
/* For FUNCTION_TYPE or METHOD_TYPE, a list of the exceptions that
- this type can raise. */
+ this type can raise. Each TREE_VALUE is a _TYPE. The TREE_VALUE
+ will be NULL_TREE to indicate a throw specification of `(...)', or,
+ equivalently, no throw specification. */
#define TYPE_RAISES_EXCEPTIONS(NODE) TYPE_NONCOPIED_PARTS (NODE)
/* The binding level associated with the namespace. */
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 8bb750a6617..8777a119412 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -1476,7 +1476,9 @@ build_exception_variant (type, raises)
for (t = TYPE_RAISES_EXCEPTIONS (v), u = raises;
t != NULL_TREE && u != NULL_TREE;
t = TREE_CHAIN (t), u = TREE_CHAIN (v))
- if (!same_type_p (TREE_VALUE (t), TREE_VALUE (u)))
+ if (((TREE_VALUE (t) != NULL_TREE)
+ != (TREE_VALUE (u) != NULL_TREE))
+ || !same_type_p (TREE_VALUE (t), TREE_VALUE (u)))
break;
if (!t && !u)
diff --git a/gcc/testsuite/g++.old-deja/g++.eh/spec5.C b/gcc/testsuite/g++.old-deja/g++.eh/spec5.C
new file mode 100644
index 00000000000..56154f973ee
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.eh/spec5.C
@@ -0,0 +1,3 @@
+// Build don't link:
+
+extern void *f(unsigned int k) throw();