aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/tree.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>1999-08-04 09:07:51 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>1999-08-04 09:07:51 +0000
commit4cc1d462013c5fcaa82b0ad82b4232bc1249b31c (patch)
treeeed4f20cf661ebad7e1110d70a77ace73ecd7837 /gcc/cp/tree.c
parentbc3c01c50781c5306a57c974c84e767479e59f73 (diff)
downloadgcc-4cc1d462013c5fcaa82b0ad82b4232bc1249b31c.zip
gcc-4cc1d462013c5fcaa82b0ad82b4232bc1249b31c.tar.gz
gcc-4cc1d462013c5fcaa82b0ad82b4232bc1249b31c.tar.bz2
cp-tree.h (empty_except_spec): New global var.
* cp-tree.h (empty_except_spec): New global var. (compexcepttypes): Remove prototype. (comp_except_specs): Prototype new global function. (add_exception_specifier): Prototype new global function. * decl.c (empty_except_spec): Define new global var. (duplicate_decls): Use comp_except_specs, reword error message. (init_decl_processing): Initialize empty_except_spec. Adjust build_exception_variant calls. * parse.y (exception_specification_opt): Use empty_except_spec. (ansi_raise_identifier): Call check_for_new_type. (ansi_raise_identifiers): Use add_exception_specifier. * pt.c (tsubst): Use add_exception_specifier to build exception specifier. * search.c (check_final_overrider): New static function, broken out of get_matching_virtual. Check throw specifiers, reword diagnostics. (get_matching_virtual): Use check_final_overrider. * tree.c (build_exception_variant): Use comp_except_specs. * typeck.c (compexcepttypes): Remove. (comp_except_types): New static function, helper for comp_except_specs. Compare two types as exception specifiers. (comp_except_specs): New global function, compare two exception specifiers. (comptypes): Adjust for comp_except_specs. * typeck2.c (add_exception_specifier): New global function. * class.c (check_for_override): Reword error message. From-SVN: r28494
Diffstat (limited to 'gcc/cp/tree.c')
-rw-r--r--gcc/cp/tree.c22
1 files changed, 3 insertions, 19 deletions
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index ab71470..f40632a 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -1484,25 +1484,9 @@ build_exception_variant (type, raises)
int type_quals = TYPE_QUALS (type);
for (; v; v = TYPE_NEXT_VARIANT (v))
- {
- tree t;
- tree u;
-
- if (TYPE_QUALS (v) != type_quals)
- continue;
-
- for (t = TYPE_RAISES_EXCEPTIONS (v), u = raises;
- t != NULL_TREE && u != NULL_TREE;
- t = TREE_CHAIN (t), u = TREE_CHAIN (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)
- /* There's a memory leak here; RAISES is not freed. */
- return v;
- }
+ if (TYPE_QUALS (v) == type_quals
+ && comp_except_specs (raises, TYPE_RAISES_EXCEPTIONS (v), 1))
+ return v;
/* Need to build a new variant. */
v = build_type_copy (type);