Commit caa40bc0 by Jason Merrill Committed by Jason Merrill

re PR c++/59296 ([c++11] ref-qualified member function is ambiguous)

	PR c++/59296
	* call.c (add_function_candidate): Avoid special 'this' handling
	if we have a ref-qualifier.

From-SVN: r211854
parent e2498d54
2014-06-20 Jason Merrill <jason@redhat.com> 2014-06-20 Jason Merrill <jason@redhat.com>
PR c++/59296
* call.c (add_function_candidate): Avoid special 'this' handling
if we have a ref-qualifier.
PR c++/61556 PR c++/61556
* call.c (build_over_call): Call build_this in template path. * call.c (build_over_call): Call build_this in template path.
......
...@@ -2025,9 +2025,9 @@ add_function_candidate (struct z_candidate **candidates, ...@@ -2025,9 +2025,9 @@ add_function_candidate (struct z_candidate **candidates,
object parameter has reference type. */ object parameter has reference type. */
bool rv = FUNCTION_RVALUE_QUALIFIED (TREE_TYPE (fn)); bool rv = FUNCTION_RVALUE_QUALIFIED (TREE_TYPE (fn));
parmtype = cp_build_reference_type (parmtype, rv); parmtype = cp_build_reference_type (parmtype, rv);
/* Don't bind an rvalue to a const lvalue ref-qualifier. */ /* The special handling of 'this' conversions in compare_ics
if (!rv) does not apply if there is a ref-qualifier. */
lflags |= LOOKUP_NO_RVAL_BIND|LOOKUP_NO_TEMP_BIND; is_this = false;
} }
else else
{ {
...@@ -8597,10 +8597,11 @@ compare_ics (conversion *ics1, conversion *ics2) ...@@ -8597,10 +8597,11 @@ compare_ics (conversion *ics1, conversion *ics2)
/* [over.ics.rank] /* [over.ics.rank]
--S1 and S2 are reference bindings (_dcl.init.ref_) and neither refers --S1 and S2 are reference bindings (_dcl.init.ref_) and neither refers
to an implicit object parameter, and either S1 binds an lvalue reference to an implicit object parameter of a non-static member function
to an lvalue and S2 binds an rvalue reference or S1 binds an rvalue declared without a ref-qualifier, and either S1 binds an lvalue
reference to an rvalue and S2 binds an lvalue reference reference to an lvalue and S2 binds an rvalue reference or S1 binds an
(C++0x draft standard, 13.3.3.2) rvalue reference to an rvalue and S2 binds an lvalue reference (C++0x
draft standard, 13.3.3.2)
--S1 and S2 are reference bindings (_dcl.init.ref_), and the --S1 and S2 are reference bindings (_dcl.init.ref_), and the
types to which the references refer are the same type except for types to which the references refer are the same type except for
......
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