diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-06-20 18:32:35 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-06-20 18:32:35 +0000 |
commit | fdb268b3942efc05f05b1a2971a9be869137d16f (patch) | |
tree | 6f2ff02ff6f7e5de655b02a7260beb58d094b618 /gcc/cp/call.c | |
parent | 2a08bfb628f1d8ae4683483157c554d0ca013c4e (diff) | |
download | gcc-fdb268b3942efc05f05b1a2971a9be869137d16f.tar.gz |
PR c++/59296
* call.c (add_function_candidate): Avoid special 'this' handling
if we have a ref-qualifier.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@211854 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/call.c')
-rw-r--r-- | gcc/cp/call.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/gcc/cp/call.c b/gcc/cp/call.c index da914330049..4847c3a2c2b 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -2025,9 +2025,9 @@ add_function_candidate (struct z_candidate **candidates, object parameter has reference type. */ bool rv = FUNCTION_RVALUE_QUALIFIED (TREE_TYPE (fn)); parmtype = cp_build_reference_type (parmtype, rv); - /* Don't bind an rvalue to a const lvalue ref-qualifier. */ - if (!rv) - lflags |= LOOKUP_NO_RVAL_BIND|LOOKUP_NO_TEMP_BIND; + /* The special handling of 'this' conversions in compare_ics + does not apply if there is a ref-qualifier. */ + is_this = false; } else { @@ -8597,10 +8597,11 @@ compare_ics (conversion *ics1, conversion *ics2) /* [over.ics.rank] --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 lvalue and S2 binds an rvalue reference or S1 binds an rvalue - reference to an rvalue and S2 binds an lvalue reference - (C++0x draft standard, 13.3.3.2) + to an implicit object parameter of a non-static member function + declared without a ref-qualifier, and either S1 binds an lvalue + reference to an lvalue and S2 binds an rvalue reference or S1 binds an + 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 types to which the references refer are the same type except for |