* pt.c (tsubst_pack_expansion): Fix SFINAE.

From-SVN: r181548
This commit is contained in:
Jason Merrill 2011-11-20 21:05:03 -05:00 committed by Jason Merrill
parent c67dd25689
commit 25a9676197
3 changed files with 30 additions and 1 deletions

View File

@ -1,5 +1,7 @@
2011-11-20 Jason Merrill <jason@redhat.com>
* pt.c (tsubst_pack_expansion): Fix SFINAE.
PR c++/48322
* cp-tree.h (PACK_EXPANSION_EXTRA_ARGS): New.
* cp-tree.def (EXPR_PACK_EXPANSION): Add an operand for it.

View File

@ -9350,7 +9350,9 @@ tsubst_pack_expansion (tree t, tree args, tsubst_flags_t complain,
len = my_len;
else if (len != my_len)
{
if (TREE_CODE (t) == TYPE_PACK_EXPANSION)
if (!(complain & tf_error))
/* Fail quietly. */;
else if (TREE_CODE (t) == TYPE_PACK_EXPANSION)
error ("mismatched argument pack lengths while expanding "
"%<%T%>",
pattern);

View File

@ -0,0 +1,25 @@
// { dg-do compile { target c++11 } }
template <class... T> struct tuple;
template <class T> struct tuple<T> { T t; };
template <class T, class U> struct pair;
template<> struct pair<int,double> { };
template <class... Ts>
struct A
{
template <class... Us,
class V = tuple<pair<Ts,Us>...> >
static void f(Us...)
{
V v;
}
template <class U>
static void f(bool);
};
int main()
{
A<int,float>::f<double>(1.0);
}