Commit f7d5a7cd by Jason Merrill Committed by Jason Merrill

re PR c++/36816 ([c++0x] error deducing template argument taking the address of…

re PR c++/36816 ([c++0x] error deducing template argument taking the address of rvalue reference template)

	PR c++/36816
	* pt.c (maybe_adjust_types_for_deduction): Do rvalue ref adjustment
	even when DEDUCE_EXACT.

From-SVN: r152565
parent ccb05613
2009-10-08 Jason Merrill <jason@redhat.com>
PR c++/36816
* pt.c (maybe_adjust_types_for_deduction): Do rvalue ref adjustment
even when DEDUCE_EXACT.
PR c++/37177
* pt.c (resolve_nondeduced_context): New.
* cvt.c (convert_to_void): Call it.
......
......@@ -12906,7 +12906,17 @@ maybe_adjust_types_for_deduction (unification_kind_t strict,
}
case DEDUCE_EXACT:
/* There is nothing to do in this case. */
/* Core issue #873: Do the DR606 thing (see below) for these cases,
too, but here handle it by stripping the reference from PARM
rather than by adding it to ARG. */
if (TREE_CODE (*parm) == REFERENCE_TYPE
&& TYPE_REF_IS_RVALUE (*parm)
&& TREE_CODE (TREE_TYPE (*parm)) == TEMPLATE_TYPE_PARM
&& cp_type_quals (TREE_TYPE (*parm)) == TYPE_UNQUALIFIED
&& TREE_CODE (*arg) == REFERENCE_TYPE
&& !TYPE_REF_IS_RVALUE (*arg))
*parm = TREE_TYPE (*parm);
/* Nothing else to do in this case. */
return 0;
default:
......
2009-10-08 Jason Merrill <jason@redhat.com>
* g++.dg/cpp0x/rv-deduce.C: New.
PR c++/37177
* g++.dg/cpp0x/variadic-throw.C: Adjust errors.
* g++.dg/template/explicit-args2.C: New.
......
// PR c++/36816, core issue 873
// { dg-options -std=c++0x }
template <class T> void h (T&&) { }
void (*pf)(int&) = &h;
template <> void h(char&);
template void h(double&);
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