[PATCH] D43277: limits: Use `false` instead of `type(0)`.

Bruce Mitchener via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 13 20:47:47 PST 2018


brucem created this revision.
brucem added reviewers: mclow.lists, EricWF.

This fixes warnings when using clang-tidy and the
`modernize-use-bool-literals` check.


Repository:
  rCXX libc++

https://reviews.llvm.org/D43277

Files:
  include/limits


Index: include/limits
===================================================================
--- include/limits
+++ include/limits
@@ -269,8 +269,8 @@
     static _LIBCPP_CONSTEXPR const bool is_integer = true;
     static _LIBCPP_CONSTEXPR const bool is_exact = true;
     static _LIBCPP_CONSTEXPR const int  radix = 2;
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT {return type(0);}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT {return type(0);}
+    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT {return false;}
+    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT {return false;}
 
     static _LIBCPP_CONSTEXPR const int  min_exponent = 0;
     static _LIBCPP_CONSTEXPR const int  min_exponent10 = 0;
@@ -282,10 +282,10 @@
     static _LIBCPP_CONSTEXPR const bool has_signaling_NaN = false;
     static _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = denorm_absent;
     static _LIBCPP_CONSTEXPR const bool has_denorm_loss = false;
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT {return type(0);}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT {return type(0);}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return type(0);}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return type(0);}
+    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT {return false;}
+    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT {return false;}
+    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return false;}
+    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return false;}
 
     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
     static _LIBCPP_CONSTEXPR const bool is_bounded = true;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43277.134160.patch
Type: text/x-patch
Size: 2009 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180214/888ea0a8/attachment-0001.bin>


More information about the cfe-commits mailing list