Commit c2c6f744 by Jason Merrill Committed by Jason Merrill

re PR c++/48313 ([C++0x] std::bind with template function)

	PR c++/48313
	* pt.c (maybe_adjust_types_for_deduction): Handle T&& deduction
	from overloaded function.

From-SVN: r171643
parent 71dae1fe
2011-03-28 Jason Merrill <jason@redhat.com>
PR c++/48313
* pt.c (maybe_adjust_types_for_deduction): Handle T&& deduction
from overloaded function.
Core 1232
* call.c (build_array_conv): New.
(implicit_conversion): Use it.
......
......@@ -13936,7 +13936,10 @@ maybe_adjust_types_for_deduction (unification_kind_t strict,
&& TYPE_REF_IS_RVALUE (*parm)
&& TREE_CODE (TREE_TYPE (*parm)) == TEMPLATE_TYPE_PARM
&& cp_type_quals (TREE_TYPE (*parm)) == TYPE_UNQUALIFIED
&& arg_expr && real_lvalue_p (arg_expr))
&& (arg_expr ? real_lvalue_p (arg_expr)
/* try_one_overload doesn't provide an arg_expr, but
functions are always lvalues. */
: TREE_CODE (*arg) == FUNCTION_TYPE))
*arg = build_reference_type (*arg);
/* [temp.deduct.call]
......
2011-03-28 Jason Merrill <jason@redhat.com>
* g++.dg/cpp0x/rv-deduce2.C: New.
2011-03-29 Jakub Jelinek <jakub@redhat.com>
PR debug/48203
......
// PR c++/48313
// { dg-options -std=c++0x }
template<typename F>
void f(F&&) { }
void g() { }
template<typename T> void h() { }
int main()
{
f( g ); // OK
void (&p)() = h<int>;
f( p ); // OK
f( h<int> ); // ???
}
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