[ms-cxxabi] Add a new calling convention that swaps 'this' and 'sret'
[oota-llvm.git] / include / llvm / ADT / polymorphic_ptr.h
index 6114b65a309dece89415dc24e186e911c7bae31e..b8d8d71238e3c26a2a0d0386dc9327bd62739044 100644 (file)
@@ -38,8 +38,8 @@ template <typename T> class polymorphic_ptr {
   T *ptr;
 
 public:
-  explicit polymorphic_ptr(T *ptr = 0) : ptr(ptr) {}
-  polymorphic_ptr(const polymorphic_ptr &arg) : ptr(arg->clone()) {}
+  polymorphic_ptr(T *ptr = 0) : ptr(ptr) {}
+  polymorphic_ptr(const polymorphic_ptr &arg) : ptr(arg ? arg->clone() : 0) {}
 #if LLVM_HAS_RVALUE_REFERENCES
   polymorphic_ptr(polymorphic_ptr &&arg) : ptr(arg.take()) {}
 #endif