Fix non-variadic function_ref cases to match r221753
[oota-llvm.git] / include / llvm / ADT / TinyPtrVector.h
index 5e0a119b46f04cde50f9e314f25eb5363322ba20..e158f9d278b207074a186bca8b58cffa4523d5c2 100644 (file)
@@ -92,14 +92,14 @@ public:
     }
 
     Val = RHS.Val;
-    RHS.Val = nullptr;
+    RHS.Val = (EltTy)nullptr;
     return *this;
   }
 
   // implicit conversion operator to ArrayRef.
   operator ArrayRef<EltTy>() const {
     if (Val.isNull())
-      return ArrayRef<EltTy>();
+      return None;
     if (Val.template is<EltTy>())
       return *Val.getAddrOfPtr1();
     return *Val.template get<VecTy*>();
@@ -195,7 +195,7 @@ public:
   void pop_back() {
     // If we have a single value, convert to empty.
     if (Val.template is<EltTy>())
-      Val = nullptr;
+      Val = (EltTy)nullptr;
     else if (VecTy *Vec = Val.template get<VecTy*>())
       Vec->pop_back();
   }
@@ -218,7 +218,7 @@ public:
     // If we have a single value, convert to empty.
     if (Val.template is<EltTy>()) {
       if (I == begin())
-        Val = nullptr;
+        Val = (EltTy)nullptr;
     } else if (VecTy *Vec = Val.template dyn_cast<VecTy*>()) {
       // 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<EltTy>()) {
       if (S == begin() && S != E)
-        Val = nullptr;
+        Val = (EltTy)nullptr;
     } else if (VecTy *Vec = Val.template dyn_cast<VecTy*>()) {
       return Vec->erase(S, E);
     }