summaryrefslogtreecommitdiffstats
path: root/unittests
diff options
context:
space:
mode:
Diffstat (limited to 'unittests')
-rw-r--r--unittests/ADT/polymorphic_ptr_test.cpp4
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);