Commit 25a96761 by Jason Merrill Committed by Jason Merrill

* pt.c (tsubst_pack_expansion): Fix SFINAE.

From-SVN: r181548
parent c67dd256
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.
......
......@@ -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);
......
// { 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);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment