]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/49267 (Ambiguity with conversion functions "T&" and "T&&", initializing...
authorJason Merrill <jason@redhat.com>
Mon, 5 Sep 2011 04:33:57 +0000 (00:33 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 5 Sep 2011 04:33:57 +0000 (00:33 -0400)
PR c++/49267
* call.c (reference_binding): Don't set is_lvalue for an rvalue
reference rfrom.

From-SVN: r178521

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

index 718bcb3b9856cf0e411efd35fc12ad8e47eb4c12..b676dd14073de28b9aed7ca9b399bdadddbf0819 100644 (file)
@@ -1,5 +1,9 @@
 2011-09-04  Jason Merrill  <jason@redhat.com>
 
+       PR c++/49267
+       * call.c (reference_binding): Don't set is_lvalue for an rvalue
+       reference rfrom.
+
        PR c++/49267
        PR c++/49458
        DR 1328
index 1fa5fc81852e2e58acb12cc9c817472c20abbc73..c707d663e245cd8a374523654288ccabcb675be0 100644 (file)
@@ -1576,9 +1576,10 @@ reference_binding (tree rto, tree rfrom, tree expr, bool c_cast_p, int flags)
 
   if (TREE_CODE (from) == REFERENCE_TYPE)
     {
-      /* Anything with reference type is an lvalue.  */
-      is_lvalue = clk_ordinary;
       from = TREE_TYPE (from);
+      if (!TYPE_REF_IS_RVALUE (rfrom)
+         || TREE_CODE (from) == FUNCTION_TYPE)
+       is_lvalue = clk_ordinary;
     }
 
   if (expr && BRACE_ENCLOSED_INITIALIZER_P (expr))