Commit e3dc80be by Jason Merrill Committed by Jason Merrill

re PR c++/61507 (GCC does not compile function with parameter pack.)

	PR c++/61507
	* pt.c (resolve_overloaded_unification): Preserve
	ARGUMENT_PACK_EXPLICIT_ARGS.

From-SVN: r211808
parent be6b0bec
2014-06-18 Jason Merrill <jason@redhat.com>
PR c++/61507
* pt.c (resolve_overloaded_unification): Preserve
ARGUMENT_PACK_EXPLICIT_ARGS.
2014-06-18 Jakub Jelinek <jakub@redhat.com>
* cp-gimplify.c (cxx_omp_finish_clause): Add a gimple_seq *
......
......@@ -16838,7 +16838,16 @@ resolve_overloaded_unification (tree tparms,
int i = TREE_VEC_LENGTH (targs);
for (; i--; )
if (TREE_VEC_ELT (tempargs, i))
TREE_VEC_ELT (targs, i) = TREE_VEC_ELT (tempargs, i);
{
tree old = TREE_VEC_ELT (targs, i);
tree new_ = TREE_VEC_ELT (tempargs, i);
if (new_ && old && ARGUMENT_PACK_P (old)
&& ARGUMENT_PACK_EXPLICIT_ARGS (old))
/* Don't forget explicit template arguments in a pack. */
ARGUMENT_PACK_EXPLICIT_ARGS (new_)
= ARGUMENT_PACK_EXPLICIT_ARGS (old);
TREE_VEC_ELT (targs, i) = new_;
}
}
if (good)
return true;
......
// PR c++/61507
// { dg-do compile { target c++11 } }
struct A {
void foo(const int &);
void foo(float);
};
template <typename... Args>
void bar(void (A::*memfun)(Args...), Args... args);
void go(const int& i) {
bar<const int &>(&A::foo, i);
}
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