Make this operator bool() explicit to match the standard library.
authorRafael Espindola <rafael.espindola@gmail.com>
Tue, 3 Jun 2014 04:54:15 +0000 (04:54 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Tue, 3 Jun 2014 04:54:15 +0000 (04:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210073 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/system_error.h

index 8b3d9cc0c7038e1390a079d672e611e16a02b2b2..104cbc42e56539e19d6437aaf8a9ad3645f74bc5 100644 (file)
@@ -692,12 +692,7 @@ public:
   const error_category& category() const {return *_cat_;}
   std::string message() const;
 
-  typedef void (*unspecified_bool_type)();
-  static void unspecified_bool_true() {}
-
-  operator unspecified_bool_type() const { // true if error
-    return _val_ == 0 ? nullptr : unspecified_bool_true;
-  }
+  LLVM_EXPLICIT operator bool() const { return _val_ != 0; }
 };
 
 inline error_condition make_error_condition(errc _e) {