re PR c++/59296 ([c++11] ref-qualified member function is ambiguous)
authorJason Merrill <jason@redhat.com>
Thu, 19 Jun 2014 09:36:09 +0000 (05:36 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 19 Jun 2014 09:36:09 +0000 (05:36 -0400)
PR c++/59296
* call.c (add_function_candidate): Also set LOOKUP_NO_TEMP_BIND.

From-SVN: r211821

gcc/cp/ChangeLog
gcc/cp/call.c

index 7e7521b..a992c87 100644 (file)
@@ -1,3 +1,8 @@
+2014-06-19  Jason Merrill  <jason@redhat.com>
+
+       PR c++/59296
+       * call.c (add_function_candidate): Also set LOOKUP_NO_TEMP_BIND.
+
 2014-06-18  Jason Merrill  <jason@redhat.com>
 
        PR c++/59296
index b4adf36..e147abd 100644 (file)
@@ -2026,7 +2026,8 @@ add_function_candidate (struct z_candidate **candidates,
                  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.  */
-                 lflags |= LOOKUP_NO_RVAL_BIND;
+                 if (!rv)
+                   lflags |= LOOKUP_NO_RVAL_BIND|LOOKUP_NO_TEMP_BIND;
                }
              else
                {