[llvm] r194318 - Use something really explicit to test "move semantics" on builds without

Chandler Carruth chandlerc at gmail.com
Fri Nov 8 20:49:27 PST 2013


Author: chandlerc
Date: Fri Nov  8 22:49:27 2013
New Revision: 194318

URL: http://llvm.org/viewvc/llvm-project?rev=194318&view=rev
Log:
Use something really explicit to test "move semantics" on builds without
r-value references. I still want to test that when we have them,
llvm_move is actually a move.

Have I mentioned that I really want to move to C++11? ;]

Modified:
    llvm/trunk/unittests/ADT/polymorphic_ptr_test.cpp

Modified: llvm/trunk/unittests/ADT/polymorphic_ptr_test.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ADT/polymorphic_ptr_test.cpp?rev=194318&r1=194317&r2=194318&view=diff
==============================================================================
--- llvm/trunk/unittests/ADT/polymorphic_ptr_test.cpp (original)
+++ llvm/trunk/unittests/ADT/polymorphic_ptr_test.cpp Fri Nov  8 22:49:27 2013
@@ -57,6 +57,10 @@ TEST(polymorphic_ptr_test, Basic) {
   EXPECT_EQ(42, p->x);
 
   polymorphic_ptr<S> p2((llvm_move(p)));
+#if !LLVM_HAS_RVALUE_REFERENCES
+  // 'p' may not have been moved from in C++98, fake it for the test.
+  p2 = p.take();
+#endif
   EXPECT_FALSE((bool)p);
   EXPECT_TRUE(!p);
   EXPECT_TRUE((bool)p2);





More information about the llvm-commits mailing list