summaryrefslogtreecommitdiff
path: root/include/llvm/Support/system_error.h
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-06-03 04:42:24 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-06-03 04:42:24 +0000
commit08e66be96d6b019e574d7d0801d198cd9c584f21 (patch)
tree50f478b5e9370cf5f5a3c836e4c141d86a805bce /include/llvm/Support/system_error.h
parentc69c42240ef96fcde3e6299f5c8f388643b1d840 (diff)
downloadllvm-08e66be96d6b019e574d7d0801d198cd9c584f21.tar.gz
llvm-08e66be96d6b019e574d7d0801d198cd9c584f21.tar.bz2
llvm-08e66be96d6b019e574d7d0801d198cd9c584f21.tar.xz
Make this operator bool() explicit to match the standard library.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210072 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/system_error.h')
-rw-r--r--include/llvm/Support/system_error.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/include/llvm/Support/system_error.h b/include/llvm/Support/system_error.h
index 9d300fb991..8b3d9cc0c7 100644
--- a/include/llvm/Support/system_error.h
+++ b/include/llvm/Support/system_error.h
@@ -753,11 +753,8 @@ public:
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;
}
};