summaryrefslogtreecommitdiffstats
path: root/unittests
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2013-11-09 05:55:03 +0000
committerChandler Carruth <chandlerc@gmail.com>2013-11-09 05:55:03 +0000
commit3481cdc57382b315c96ad82a6e166f9914dadddb (patch)
treeb9502ae1df0bdf5e31046c3471d6e4412c304a89 /unittests
parentc197a3ab4d1498198bc190216bce41ee3887ad3a (diff)
downloadexternal_llvm-3481cdc57382b315c96ad82a6e166f9914dadddb.zip
external_llvm-3481cdc57382b315c96ad82a6e166f9914dadddb.tar.gz
external_llvm-3481cdc57382b315c96ad82a6e166f9914dadddb.tar.bz2
Switch to allow implicit construction. In many cases, we're wrapping
a derived type and this makes it *much* easier to write this code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194321 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r--unittests/ADT/polymorphic_ptr_test.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/unittests/ADT/polymorphic_ptr_test.cpp b/unittests/ADT/polymorphic_ptr_test.cpp
index d9a2c3f..fbe60df 100644
--- a/unittests/ADT/polymorphic_ptr_test.cpp
+++ b/unittests/ADT/polymorphic_ptr_test.cpp
@@ -113,6 +113,11 @@ TEST(polymorphic_ptr_test, Polymorphism) {
copy = dummy_copy(b);
EXPECT_NE(b, copy);
EXPECT_EQ("DerivedB", copy->name());
+
+ // Test creating a copy out of a temporary directly.
+ copy = dummy_copy<polymorphic_ptr<Base> >(new DerivedA());
+ EXPECT_NE(a, copy);
+ EXPECT_EQ("DerivedA", copy->name());
}
}