BillyONeal created this revision.
BillyONeal added reviewers: EricWF, mclow.lists.

If a standard library implements LWG 1203 (which I am implementing in MSVC++ 
right now) the return value of (istringstream() << A{}) is an rvalue, so it 
can't have an lvalue reference bound to it. Change this test to bind a 
forwarding reference instead which allows both standard behavior and LWG 1203 
proposed behavior.

Note that LWG 1203 is presently not accepted.


https://reviews.llvm.org/D47400

Files:
  
test/std/input.output/iostream.format/input.streams/istream.rvalue/rvalue.pass.cpp


Index: 
test/std/input.output/iostream.format/input.streams/istream.rvalue/rvalue.pass.cpp
===================================================================
--- 
test/std/input.output/iostream.format/input.streams/istream.rvalue/rvalue.pass.cpp
+++ 
test/std/input.output/iostream.format/input.streams/istream.rvalue/rvalue.pass.cpp
@@ -65,7 +65,7 @@
     { // test perfect forwarding
         assert(called == false);
         std::istringstream ss;
-        auto& out = (std::move(ss) >> A{});
+        auto&& out = (std::move(ss) >> A{});
         assert(&out == &ss);
         assert(called);
     }


Index: test/std/input.output/iostream.format/input.streams/istream.rvalue/rvalue.pass.cpp
===================================================================
--- test/std/input.output/iostream.format/input.streams/istream.rvalue/rvalue.pass.cpp
+++ test/std/input.output/iostream.format/input.streams/istream.rvalue/rvalue.pass.cpp
@@ -65,7 +65,7 @@
     { // test perfect forwarding
         assert(called == false);
         std::istringstream ss;
-        auto& out = (std::move(ss) >> A{});
+        auto&& out = (std::move(ss) >> A{});
         assert(&out == &ss);
         assert(called);
     }
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to