OSDN Git Service

PR c++/49267
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 5 Sep 2011 04:33:57 +0000 (04:33 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 5 Sep 2011 04:33:57 +0000 (04:33 +0000)
* call.c (reference_binding): Don't set is_lvalue for an rvalue
reference rfrom.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178521 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 718bcb3..b676dd1 100644 (file)
@@ -1,6 +1,10 @@
 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
        * call.c (reference_binding): Set rvaluedness_matches_p properly
index 1fa5fc8..c707d66 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))