PR c++/79470 - partial ordering with reference parameters

* pt.c (unify) [INDIRECT_REF]: Handle pack expansions.

From-SVN: r245589
This commit is contained in:
Jason Merrill 2017-02-20 01:05:38 -05:00 committed by Jason Merrill
parent cfb825648d
commit 4cd159317c
3 changed files with 18 additions and 0 deletions

View File

@ -1,5 +1,8 @@
2017-02-19 Jason Merrill <jason@redhat.com>
PR c++/79470 - partial ordering with reference parameters
* pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
PR c++/79500 - ICE with non-template deduction guide
* pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
DECL_TEMPLATE_RESULT.

View File

@ -20918,8 +20918,13 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict,
case INDIRECT_REF:
if (REFERENCE_REF_P (parm))
{
bool pexp = PACK_EXPANSION_P (arg);
if (pexp)
arg = PACK_EXPANSION_PATTERN (arg);
if (REFERENCE_REF_P (arg))
arg = TREE_OPERAND (arg, 0);
if (pexp)
arg = make_pack_expansion (arg);
return unify (tparms, targs, TREE_OPERAND (parm, 0), arg,
strict, explain_p);
}

View File

@ -0,0 +1,10 @@
// PR c++/79470
// { dg-do compile { target c++11 } }
template < const int&... > struct AA;
template < > struct AA<> { };
template < const int& II, const int&... Is >
struct AA<II,Is...> { };