Commit 0db906f1 by Jason Merrill Committed by Jason Merrill

re PR c++/40595 ([C++0x] ICE trying to use sfinae with variadic template pack expansion)

	PR c++/40595
	* pt.c (tsubst_pack_expansion): Handle unexpanded packs in an
	EXPR_PACK_EXPANSION.

From-SVN: r149117
parent 342f368c
2009-06-30 Jason Merrill <jason@redhat.com>
PR c++/40595
* pt.c (tsubst_pack_expansion): Handle unexpanded packs in an
EXPR_PACK_EXPANSION.
2009-06-29 Jason Merrill <jason@redhat.com> 2009-06-29 Jason Merrill <jason@redhat.com>
PR c++/40274 PR c++/40274
......
...@@ -7630,8 +7630,15 @@ tsubst_pack_expansion (tree t, tree args, tsubst_flags_t complain, ...@@ -7630,8 +7630,15 @@ tsubst_pack_expansion (tree t, tree args, tsubst_flags_t complain,
and return a PACK_EXPANSION_*. The caller will need to deal with and return a PACK_EXPANSION_*. The caller will need to deal with
that. */ that. */
if (unsubstituted_packs) if (unsubstituted_packs)
return make_pack_expansion (tsubst (pattern, args, complain, {
in_decl)); tree new_pat;
if (TREE_CODE (t) == EXPR_PACK_EXPANSION)
new_pat = tsubst_expr (pattern, args, complain, in_decl,
/*integral_constant_expression_p=*/false);
else
new_pat = tsubst (pattern, args, complain, in_decl);
return make_pack_expansion (new_pat);
}
/* We could not find any argument packs that work. */ /* We could not find any argument packs that work. */
if (len < 0) if (len < 0)
......
2009-06-30 Jason Merrill <jason@redhat.com>
PR c++/40595
* g++.dg/cpp0x/variadic94.C: New.
2009-06-30 Richard Sandiford <r.sandiford@uk.ibm.com> 2009-06-30 Richard Sandiford <r.sandiford@uk.ibm.com>
* lib/gcc-defs.exp (gcc-set-multilib-library-path): Delete. * lib/gcc-defs.exp (gcc-set-multilib-library-path): Delete.
......
// PR c++/40595
// { dg-options "-std=c++0x" }
template<int N>
struct S
{
typedef int type;
};
template<typename T>
struct Get
{
static T get();
};
template<typename F>
struct B
{
template<typename ... Args>
typename S<sizeof( Get<F>::get() (Get<Args>::get() ...) )>::type
f(Args&& ... a);
};
struct X
{
bool operator()(int) const;
};
int main()
{
B<X> b;
b.f(1);
}
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