[llvm] r210073 - Make this operator bool() explicit to match the standard library.
Rafael Espindola
rafael.espindola at gmail.com
Mon Jun 2 21:54:15 PDT 2014
Author: rafael
Date: Mon Jun 2 23:54:15 2014
New Revision: 210073
URL: http://llvm.org/viewvc/llvm-project?rev=210073&view=rev
Log:
Make this operator bool() explicit to match the standard library.
Modified:
llvm/trunk/include/llvm/Support/system_error.h
Modified: llvm/trunk/include/llvm/Support/system_error.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/system_error.h?rev=210073&r1=210072&r2=210073&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/system_error.h (original)
+++ llvm/trunk/include/llvm/Support/system_error.h Mon Jun 2 23:54:15 2014
@@ -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) {
More information about the llvm-commits
mailing list