From 25aea4e9685c28d426f4c381802223841fa21f13 Mon Sep 17 00:00:00 2001 From: Dodji Seketeli Date: Thu, 3 Feb 2011 19:55:00 +0000 Subject: re PR c++/47398 (tree check: accessed elt 10 of tree_vec with 9 elts in tsubst, at cp/pt.c:10500) Fix PR c++/47398 gcc/cp/ PR c++/47398 * tree.c (cp_tree_equal): Take the number of template parameters in account. gcc/testsuite/ PR c++/47398 * g++.dg/template/typedef37.C: New test. * g++.dg/template/param1.C: Adjust expected error message. From-SVN: r169807 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/tree.c | 3 +++ 2 files changed, 9 insertions(+) (limited to 'gcc/cp') diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 65edb9c..6dd6137 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2011-02-03 Dodji Seketeli + + PR c++/47398 + * tree.c (cp_tree_equal): Take the number of + template parameters in account. + 2011-02-03 Nathan Froyd PR c++/46890 diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 1a1f150..d62d242 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -2176,6 +2176,9 @@ cp_tree_equal (tree t1, tree t2) BASELINK_FUNCTIONS (t2))); case TEMPLATE_PARM_INDEX: + if (TEMPLATE_PARM_NUM_SIBLINGS (t1) + != TEMPLATE_PARM_NUM_SIBLINGS (t2)) + return false; return (TEMPLATE_PARM_IDX (t1) == TEMPLATE_PARM_IDX (t2) && TEMPLATE_PARM_LEVEL (t1) == TEMPLATE_PARM_LEVEL (t2) && (TEMPLATE_PARM_PARAMETER_PACK (t1) -- cgit v1.1