Make Optional<T>'s operator bool 'explicit' in C++11
[oota-llvm.git] / include / llvm / ADT / Optional.h
index 844e3090500665771450b07854c0b93803429971..c5dc29946cb8dcd498e0f6b5b1b8a53a53ae655a 100644 (file)
@@ -86,7 +86,7 @@ public:
   const T& getValue() const LLVM_LVALUE_FUNCTION { assert(hasVal); return *getPointer(); }
   T& getValue() LLVM_LVALUE_FUNCTION { assert(hasVal); return *getPointer(); }
 
-  operator bool() const { return hasVal; }
+  LLVM_EXPLICIT operator bool() const { return hasVal; }
   bool hasValue() const { return hasVal; }
   const T* operator->() const { return getPointer(); }
   T* operator->() { return getPointer(); }