[PATCH] D47400: [libcxx] [test] Allow a standard library that implements LWG 1203 in istream.rvalue/rvalue.pass.cpp

Billy Robert O'Neal III via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 25 16:57:01 PDT 2018

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.



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);

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47400.148690.patch
Type: text/x-patch
Size: 603 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180525/20ca29ba/attachment.bin>

More information about the cfe-commits mailing list