t2 = cxx_make_type (BOUND_TEMPLATE_TEMPLATE_PARM);
decl = build_decl (input_location,
TYPE_DECL, DECL_NAME (decl), NULL_TREE);
+ SET_DECL_TEMPLATE_PARM_P (decl);
/* These nodes have to be created to reflect new TYPE_DECL and template
arguments. */
case CALL_EXPR:
{
- tree arg1, arg2;
- call_expr_arg_iterator iter1, iter2;
- if (KOENIG_LOOKUP_P (t1) != KOENIG_LOOKUP_P (t2)
- || !called_fns_equal (CALL_EXPR_FN (t1), CALL_EXPR_FN (t2)))
+ if (KOENIG_LOOKUP_P (t1) != KOENIG_LOOKUP_P (t2))
return false;
- for (arg1 = first_call_expr_arg (t1, &iter1),
- arg2 = first_call_expr_arg (t2, &iter2);
- arg1 && arg2;
- arg1 = next_call_expr_arg (&iter1),
- arg2 = next_call_expr_arg (&iter2))
- if (!cp_tree_equal (arg1, arg2))
- return false;
- if (arg1 || arg2)
+
+ if (!called_fns_equal (CALL_EXPR_FN (t1), CALL_EXPR_FN (t2)))
+ return false;
+
+ call_expr_arg_iterator iter1, iter2;
+ init_call_expr_arg_iterator (t1, &iter1);
+ init_call_expr_arg_iterator (t2, &iter2);
+ if (iter1.n != iter2.n)
return false;
+
+ while (more_call_expr_args_p (&iter1))
+ {
+ tree arg1 = next_call_expr_arg (&iter1);
+ tree arg2 = next_call_expr_arg (&iter2);
+
+ gcc_checking_assert (arg1 && arg2);
+ if (!cp_tree_equal (arg1, arg2))
+ return false;
+ }
+
return true;
}
CHECK_CONSTR_ARGS (t2)));
case TREE_VEC:
- {
- unsigned ix;
- if (TREE_VEC_LENGTH (t1) != TREE_VEC_LENGTH (t2))
- return false;
- for (ix = TREE_VEC_LENGTH (t1); ix--;)
- if (!cp_tree_equal (TREE_VEC_ELT (t1, ix),
- TREE_VEC_ELT (t2, ix)))
- return false;
- return true;
- }
+ /* These are template args. Really we should be getting the
+ caller to do this as it knows it to be true. */
+ if (!comp_template_args (t1, t2, NULL, NULL, false))
+ return false;
+ return true;
case SIZEOF_EXPR:
case ALIGNOF_EXPR: