diff options
author | Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net> | 2004-07-19 15:03:58 +0000 |
---|---|---|
committer | Kriang Lerdsuwanakij <lerdsuwa@gcc.gnu.org> | 2004-07-19 15:03:58 +0000 |
commit | 6df91b0004725e310b8dc7fa463745a703c1c059 (patch) | |
tree | 5f12475ae2f27a76ecdf20b0bcd423cc0fab60c9 /gcc/cp | |
parent | a2bec818635587d03fa02bd57c2bf0985510de56 (diff) | |
download | gcc-6df91b0004725e310b8dc7fa463745a703c1c059.zip gcc-6df91b0004725e310b8dc7fa463745a703c1c059.tar.gz gcc-6df91b0004725e310b8dc7fa463745a703c1c059.tar.bz2 |
re PR c++/12170 (ICE in cp_type_quals)
PR c++/12170
* pt.c (unify) <BOUND_TEMPLATE_TEMPLATE_PARM case>: Use only
innermost set of template arguments during deduction. Simplify.
* g++.dg/template/ttp9.C: New test.
From-SVN: r84921
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/pt.c | 7 |
2 files changed, 9 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 00ef4b5..f4db5d3 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2004-07-19 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net> + + PR c++/12170 + * pt.c (unify) <BOUND_TEMPLATE_TEMPLATE_PARM case>: Use only + innermost set of template arguments during deduction. Simplify. + 2004-07-19 Joseph S. Myers <jsm@polyomino.org.uk> * typeck.c (build_modify_expr, build_x_modify_expr): Set diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 59eb9c7..b1d9de0 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -9650,7 +9650,7 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict) { tree parmtmpl = TYPE_TI_TEMPLATE (parm); tree parmvec = TYPE_TI_ARGS (parm); - tree argvec = TYPE_TI_ARGS (arg); + tree argvec = INNERMOST_TEMPLATE_ARGS (TYPE_TI_ARGS (arg)); tree argtmplvec = DECL_INNERMOST_TEMPLATE_PARMS (TYPE_TI_TEMPLATE (arg)); int i; @@ -9673,9 +9673,8 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict) for (i = 0; i < TREE_VEC_LENGTH (parmvec); ++i) { - tree t = TREE_VEC_ELT (parmvec, i); - - if (unify (tparms, targs, t, + if (unify (tparms, targs, + TREE_VEC_ELT (parmvec, i), TREE_VEC_ELT (argvec, i), UNIFY_ALLOW_NONE)) return 1; |