2011-09-04 Jason Merrill <jason@redhat.com>
+ PR c++/49267
+ PR c++/49458
+ DR 1328
+ * call.c (reference_binding): Set rvaluedness_matches_p properly
+ for reference to function conversion ops.
+ (compare_ics): Adjust.
+
* class.c (trivial_default_constructor_is_constexpr): Rename from
synthesized_default_constructor_is_constexpr.
(type_has_constexpr_default_constructor): Adjust.
/* The top-level caller requested that we pretend that the lvalue
be treated as an rvalue. */
conv->rvaluedness_matches_p = TYPE_REF_IS_RVALUE (rto);
+ else if (TREE_CODE (rfrom) == REFERENCE_TYPE)
+ /* Handle rvalue reference to function properly. */
+ conv->rvaluedness_matches_p
+ = (TYPE_REF_IS_RVALUE (rto) == TYPE_REF_IS_RVALUE (rfrom));
else
conv->rvaluedness_matches_p
= (TYPE_REF_IS_RVALUE (rto) == !is_lvalue);
if (ref_conv1 && ref_conv2)
{
- if (!ref_conv1->this_p && !ref_conv2->this_p
- && (TYPE_REF_IS_RVALUE (ref_conv1->type)
- != TYPE_REF_IS_RVALUE (ref_conv2->type)))
+ if (!ref_conv1->this_p && !ref_conv2->this_p)
{
- if (ref_conv1->rvaluedness_matches_p)
+ if (ref_conv1->rvaluedness_matches_p
+ > ref_conv2->rvaluedness_matches_p)
return 1;
- if (ref_conv2->rvaluedness_matches_p)
+ if (ref_conv2->rvaluedness_matches_p
+ > ref_conv1->rvaluedness_matches_p)
return -1;
}
2011-09-04 Jason Merrill <jason@redhat.com>
+ PR c++/49267
+ * g++.dg/cpp0x/rv-conv1.C: New.
+
+ DR 1328
+ * g++.dg/cpp0x/rv-func3.C: New.
+
* g++.dg/cpp0x/constexpr-default-ctor.C: New.
PR c++/50248