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
This commit is contained in:
parent
a2bec81863
commit
6df91b0004
|
@ -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>
|
2004-07-19 Joseph S. Myers <jsm@polyomino.org.uk>
|
||||||
|
|
||||||
* typeck.c (build_modify_expr, build_x_modify_expr): Set
|
* typeck.c (build_modify_expr, build_x_modify_expr): Set
|
||||||
|
|
|
@ -9650,7 +9650,7 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict)
|
||||||
{
|
{
|
||||||
tree parmtmpl = TYPE_TI_TEMPLATE (parm);
|
tree parmtmpl = TYPE_TI_TEMPLATE (parm);
|
||||||
tree parmvec = TYPE_TI_ARGS (parm);
|
tree parmvec = TYPE_TI_ARGS (parm);
|
||||||
tree argvec = TYPE_TI_ARGS (arg);
|
tree argvec = INNERMOST_TEMPLATE_ARGS (TYPE_TI_ARGS (arg));
|
||||||
tree argtmplvec
|
tree argtmplvec
|
||||||
= DECL_INNERMOST_TEMPLATE_PARMS (TYPE_TI_TEMPLATE (arg));
|
= DECL_INNERMOST_TEMPLATE_PARMS (TYPE_TI_TEMPLATE (arg));
|
||||||
int i;
|
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)
|
for (i = 0; i < TREE_VEC_LENGTH (parmvec); ++i)
|
||||||
{
|
{
|
||||||
tree t = TREE_VEC_ELT (parmvec, i);
|
if (unify (tparms, targs,
|
||||||
|
TREE_VEC_ELT (parmvec, i),
|
||||||
if (unify (tparms, targs, t,
|
|
||||||
TREE_VEC_ELT (argvec, i),
|
TREE_VEC_ELT (argvec, i),
|
||||||
UNIFY_ALLOW_NONE))
|
UNIFY_ALLOW_NONE))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
2004-07-19 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
|
||||||
|
|
||||||
|
PR c++/12170
|
||||||
|
* g++.dg/template/ttp9.C: New test.
|
||||||
|
|
||||||
2004-07-19 Daniel Jacobowitz <dan@debian.org>
|
2004-07-19 Daniel Jacobowitz <dan@debian.org>
|
||||||
|
|
||||||
* gcc.dg/format/cmn-err-1.c: New test.
|
* gcc.dg/format/cmn-err-1.c: New test.
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
// { dg-do compile }
|
||||||
|
|
||||||
|
// Origin: David Abrahams <dave@boost-consulting.com>
|
||||||
|
// Wolfgang Bangerth <bangerth@ticam.utexas.edu>
|
||||||
|
|
||||||
|
// PR c++/12170: Deducing template template parameter from nested
|
||||||
|
// class template.
|
||||||
|
|
||||||
|
template <typename> struct W {};
|
||||||
|
|
||||||
|
template< template<typename> class F, typename T>
|
||||||
|
int foo(W< F<T> >);
|
||||||
|
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
struct L {
|
||||||
|
static int const value = sizeof(foo(W<T>()));
|
||||||
|
typedef T type;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
template <typename>
|
||||||
|
struct Y {
|
||||||
|
template <typename> struct X { typedef int type; };
|
||||||
|
typedef typename L<X<int> >::type type;
|
||||||
|
};
|
||||||
|
|
||||||
|
template struct Y<int>;
|
Loading…
Reference in New Issue