[PATCH] D62782: Fix -Wdouble-promotion warnings.

Bruce Mitchener via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 1 09:13:42 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL364798: Fix -Wdouble-promotion warnings. (authored by brucem, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62782/new/

https://reviews.llvm.org/D62782

Files:
  libcxx/trunk/include/limits
  libcxx/trunk/include/utility


Index: libcxx/trunk/include/limits
===================================================================
--- libcxx/trunk/include/limits
+++ libcxx/trunk/include/limits
@@ -409,7 +409,7 @@
     static _LIBCPP_CONSTEXPR const bool is_exact = false;
     static _LIBCPP_CONSTEXPR const int  radix = __FLT_RADIX__;
     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT {return __LDBL_EPSILON__;}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT {return 0.5;}
+    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT {return 0.5L;}
 
     static _LIBCPP_CONSTEXPR const int  min_exponent = __LDBL_MIN_EXP__;
     static _LIBCPP_CONSTEXPR const int  min_exponent10 = __LDBL_MIN_10_EXP__;
Index: libcxx/trunk/include/utility
===================================================================
--- libcxx/trunk/include/utility
+++ libcxx/trunk/include/utility
@@ -1479,7 +1479,7 @@
     size_t operator()(float __v) const _NOEXCEPT
     {
         // -0.0 and 0.0 should return same hash
-       if (__v == 0.0)
+       if (__v == 0.0f)
            return 0;
         return __scalar_hash<float>::operator()(__v);
     }
@@ -1507,7 +1507,7 @@
     size_t operator()(long double __v) const _NOEXCEPT
     {
         // -0.0 and 0.0 should return same hash
-        if (__v == 0.0)
+        if (__v == 0.0L)
             return 0;
 #if defined(__i386__)
         // Zero out padding bits


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62782.207345.patch
Type: text/x-patch
Size: 1468 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190701/200279eb/attachment.bin>


More information about the cfe-commits mailing list