diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2013-11-09 04:49:27 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2013-11-09 04:49:27 +0000 |
commit | 8caea7237a8caf081d52f18b2725839bcfed84a4 (patch) | |
tree | f62f5793211ea09d23adcc20131859f11140effa /unittests | |
parent | ca020d469e2a04f6805667c49a6b36f90a1856d2 (diff) | |
download | external_llvm-8caea7237a8caf081d52f18b2725839bcfed84a4.zip external_llvm-8caea7237a8caf081d52f18b2725839bcfed84a4.tar.gz external_llvm-8caea7237a8caf081d52f18b2725839bcfed84a4.tar.bz2 |
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? ;]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194318 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r-- | unittests/ADT/polymorphic_ptr_test.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/unittests/ADT/polymorphic_ptr_test.cpp b/unittests/ADT/polymorphic_ptr_test.cpp index 90c3385..ce001d1 100644 --- a/unittests/ADT/polymorphic_ptr_test.cpp +++ b/unittests/ADT/polymorphic_ptr_test.cpp @@ -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); |