diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-01-16 23:37:23 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-01-16 23:37:23 +0000 |
commit | e82dec5c0f6708164242192cb3c9f43e2fc6ec36 (patch) | |
tree | 3594ae10623690023128b91306b193ad66290e7e /include/llvm | |
parent | ad60d3c304df0562f580b31aa91480aa854b0dfe (diff) | |
download | llvm-e82dec5c0f6708164242192cb3c9f43e2fc6ec36.tar.gz llvm-e82dec5c0f6708164242192cb3c9f43e2fc6ec36.tar.bz2 llvm-e82dec5c0f6708164242192cb3c9f43e2fc6ec36.tar.xz |
Use LLVM_EXPLICIT instead of a function pointer as bool.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199437 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r-- | include/llvm/Support/ErrorOr.h | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/include/llvm/Support/ErrorOr.h b/include/llvm/Support/ErrorOr.h index 543f50766e..39fec3b5ae 100644 --- a/include/llvm/Support/ErrorOr.h +++ b/include/llvm/Support/ErrorOr.h @@ -169,12 +169,9 @@ public: getStorage()->~storage_type(); } - typedef void (*unspecified_bool_type)(); - static void unspecified_bool_true() {} - /// \brief Return false if there is an error. - operator unspecified_bool_type() const { - return HasError ? 0 : unspecified_bool_true; + LLVM_EXPLICIT operator bool() const { + return !HasError; } reference get() { return *getStorage(); } |