summaryrefslogtreecommitdiffstats
path: root/unittests
diff options
context:
space:
mode:
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());
}
}