aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/ADT/polymorphic_ptr.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/ADT/polymorphic_ptr.h')
-rw-r--r--include/llvm/ADT/polymorphic_ptr.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/llvm/ADT/polymorphic_ptr.h b/include/llvm/ADT/polymorphic_ptr.h
index a168747..b8d8d71 100644
--- a/include/llvm/ADT/polymorphic_ptr.h
+++ b/include/llvm/ADT/polymorphic_ptr.h
@@ -39,7 +39,7 @@ template <typename T> class polymorphic_ptr {
public:
polymorphic_ptr(T *ptr = 0) : ptr(ptr) {}
- polymorphic_ptr(const polymorphic_ptr &arg) : ptr(arg->clone()) {}
+ 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