diff --git a/include/llvm/ADT/TinyPtrVector.h b/include/llvm/ADT/TinyPtrVector.h index 5e0a119b46f..5669b2a81a4 100644 --- a/include/llvm/ADT/TinyPtrVector.h +++ b/include/llvm/ADT/TinyPtrVector.h @@ -92,7 +92,7 @@ public: } Val = RHS.Val; - RHS.Val = nullptr; + RHS.Val = (EltTy)nullptr; return *this; } @@ -195,7 +195,7 @@ public: void pop_back() { // If we have a single value, convert to empty. if (Val.template is()) - Val = nullptr; + Val = (EltTy)nullptr; else if (VecTy *Vec = Val.template get()) Vec->pop_back(); } @@ -218,7 +218,7 @@ public: // If we have a single value, convert to empty. if (Val.template is()) { if (I == begin()) - Val = nullptr; + Val = (EltTy)nullptr; } else if (VecTy *Vec = Val.template dyn_cast()) { // multiple items in a vector; just do the erase, there is no // benefit to collapsing back to a pointer @@ -234,7 +234,7 @@ public: if (Val.template is()) { if (S == begin() && S != E) - Val = nullptr; + Val = (EltTy)nullptr; } else if (VecTy *Vec = Val.template dyn_cast()) { return Vec->erase(S, E); }