diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2003-08-10 15:10:35 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2003-08-10 15:10:35 +0000 |
commit | bf12d54dac71bbf2194ebdab932fed9b180c3ce3 (patch) | |
tree | 109c3a497d9166c241c1e9e9f64cc98e907d59a6 /gcc/cp/tree.c | |
parent | ffc76561784fdb1f6607af45bd37aee531e193df (diff) | |
download | gcc-bf12d54dac71bbf2194ebdab932fed9b180c3ce3.zip gcc-bf12d54dac71bbf2194ebdab932fed9b180c3ce3.tar.gz gcc-bf12d54dac71bbf2194ebdab932fed9b180c3ce3.tar.bz2 |
cp-tree.h (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): non-NULL NODE is always a TREE_VEC of non-zero size.
cp:
* cp-tree.h (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): non-NULL
NODE is always a TREE_VEC of non-zero size.
(NUM_TMPL_ARGS): NODE is always a TREE_VEC.
* decl2.c (arg_assoc): Template args will be a vec.
* error.c (dump_decl) <TEMPLATE_ID_EXPR case>: Call
dump_template_argument_list.
(dump_template_parms): Args will be a vec.
* parser.c (cp_parser_template_argument_list): Produce a
vector, not a list.
* pt.c (coerce_template_parms): Args are always vectors.
(mangle_class_name_for_template): Likewise.
(lookup_template_function): Likewise.
(lookup_template_class): Likewise.
(tsubst_template_args): Likewise.
(tsubst_baselink): Use tsubst_template_args.
(tsubst_qualified_id): Likewise.
(tsubst_copy) <TEMPLATE_ID_EXPR case>: Likewise.
(tsubst_copy_and_build) <TEMPLATE_ID_EXPR case>: Likewise.
(any_dependent_template_args_p): Args are always vectors.
* tree.c (cp_tree_equal): Add TEMPLATE_ID_EXPR case.
From-SVN: r70295
Diffstat (limited to 'gcc/cp/tree.c')
-rw-r--r-- | gcc/cp/tree.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 0fcba63..64676fd 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -1587,6 +1587,30 @@ cp_tree_equal (tree t1, tree t2) && same_type_p (TREE_TYPE (TEMPLATE_PARM_DECL (t1)), TREE_TYPE (TEMPLATE_PARM_DECL (t2)))); + case TEMPLATE_ID_EXPR: + { + unsigned ix; + tree vec1, vec2; + + if (!cp_tree_equal (TREE_OPERAND (t1, 0), TREE_OPERAND (t2, 0))) + return false; + vec1 = TREE_OPERAND (t1, 1); + vec2 = TREE_OPERAND (t2, 1); + + if (!vec1 || !vec2) + return !vec1 && !vec2; + + if (TREE_VEC_LENGTH (vec1) != TREE_VEC_LENGTH (vec2)) + return false; + + for (ix = TREE_VEC_LENGTH (vec1); ix--;) + if (!cp_tree_equal (TREE_VEC_ELT (vec1, ix), + TREE_VEC_ELT (vec2, ix))) + return false; + + return true; + } + case SIZEOF_EXPR: case ALIGNOF_EXPR: { |