summaryrefslogtreecommitdiff
path: root/include/llvm/Support
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-06-03 04:54:15 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-06-03 04:54:15 +0000
commit7d5fe32ebf8cc06c6963c7526c0c3c8001e1a6c5 (patch)
treea4c68abc369eb8ef2566fed1c48fb85646ed9d00 /include/llvm/Support
parent08e66be96d6b019e574d7d0801d198cd9c584f21 (diff)
downloadllvm-7d5fe32ebf8cc06c6963c7526c0c3c8001e1a6c5.tar.gz
llvm-7d5fe32ebf8cc06c6963c7526c0c3c8001e1a6c5.tar.bz2
llvm-7d5fe32ebf8cc06c6963c7526c0c3c8001e1a6c5.tar.xz
Make this operator bool() explicit to match the standard library.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210073 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support')
-rw-r--r--include/llvm/Support/system_error.h7
1 files changed, 1 insertions, 6 deletions
diff --git a/include/llvm/Support/system_error.h b/include/llvm/Support/system_error.h
index 8b3d9cc0c7..104cbc42e5 100644
--- a/include/llvm/Support/system_error.h
+++ b/include/llvm/Support/system_error.h
@@ -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) {