[libcxx] r289033 - Avoid C++17 guaranteed copy elision when testing for non-copyability

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 8 01:57:00 PST 2016


Author: ericwf
Date: Thu Dec  8 03:57:00 2016
New Revision: 289033

URL: http://llvm.org/viewvc/llvm-project?rev=289033&view=rev
Log:
Avoid C++17 guaranteed copy elision when testing for non-copyability

Modified:
    libcxx/trunk/test/std/input.output/stream.buffers/streambuf/streambuf.cons/copy.fail.cpp
    libcxx/trunk/test/std/thread/futures/futures.task/futures.task.members/ctor1.fail.cpp

Modified: libcxx/trunk/test/std/input.output/stream.buffers/streambuf/streambuf.cons/copy.fail.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/input.output/stream.buffers/streambuf/streambuf.cons/copy.fail.cpp?rev=289033&r1=289032&r2=289033&view=diff
==============================================================================
--- libcxx/trunk/test/std/input.output/stream.buffers/streambuf/streambuf.cons/copy.fail.cpp (original)
+++ libcxx/trunk/test/std/input.output/stream.buffers/streambuf/streambuf.cons/copy.fail.cpp Thu Dec  8 03:57:00 2016
@@ -17,9 +17,9 @@
 #include <streambuf>
 #include <cassert>
 
-std::streambuf get();
+std::streambuf &get();
 
 int main()
 {
-    std::streambuf sb = get();
+    std::streambuf sb = get(); // expected-error {{calling a protected constructor}}
 }

Modified: libcxx/trunk/test/std/thread/futures/futures.task/futures.task.members/ctor1.fail.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/futures/futures.task/futures.task.members/ctor1.fail.cpp?rev=289033&r1=289032&r2=289033&view=diff
==============================================================================
--- libcxx/trunk/test/std/thread/futures/futures.task/futures.task.members/ctor1.fail.cpp (original)
+++ libcxx/trunk/test/std/thread/futures/futures.task/futures.task.members/ctor1.fail.cpp Thu Dec  8 03:57:00 2016
@@ -28,6 +28,7 @@ typedef volatile std::packaged_task<A(in
 
 int main()
 {
-    PT p { VPT{} }; // expected-error {{no matching constructor for initialization of 'PT' (aka 'packaged_task<A (int, char)>')}}
+    VPT init{};
+    PT p{init}; // expected-error {{no matching constructor for initialization of 'PT' (aka 'packaged_task<A (int, char)>')}}
     // expected-note at future:* 1 {{candidate template ignored: disabled by 'enable_if'}}
 }




More information about the cfe-commits mailing list