[libc-commits] [libc] c4e9a43 - [libc] Fix a constexpr violation from b4e552999de518a1d006c7b84f94491beeb4092c

Benjamin Kramer via libc-commits libc-commits at lists.llvm.org
Wed Oct 25 04:37:47 PDT 2023


Author: Benjamin Kramer
Date: 2023-10-25T13:36:17+02:00
New Revision: c4e9a4377398a22e38cafe72f2793681b55c5bb1

URL: https://github.com/llvm/llvm-project/commit/c4e9a4377398a22e38cafe72f2793681b55c5bb1
DIFF: https://github.com/llvm/llvm-project/commit/c4e9a4377398a22e38cafe72f2793681b55c5bb1.diff

LOG: [libc] Fix a constexpr violation from b4e552999de518a1d006c7b84f94491beeb4092c

In msan mode this calls __msan_unpoison, which isn't constexpr.

Added: 
    

Modified: 
    libc/src/__support/FPUtil/except_value_utils.h

Removed: 
    


################################################################################
diff  --git a/libc/src/__support/FPUtil/except_value_utils.h b/libc/src/__support/FPUtil/except_value_utils.h
index 8fe3f0d3fdab869..58c3545afe0dab2 100644
--- a/libc/src/__support/FPUtil/except_value_utils.h
+++ b/libc/src/__support/FPUtil/except_value_utils.h
@@ -102,7 +102,7 @@ template <typename T, size_t N> struct ExceptValues {
 // Helper functions to set results for exceptional cases.
 template <typename T> LIBC_INLINE T round_result_slightly_down(T value_rn) {
   volatile T tmp = value_rn;
-  constexpr T MIN_NORMAL = FPBits<T>::min_normal().get_val();
+  const T MIN_NORMAL = FPBits<T>::min_normal().get_val();
   tmp = tmp - MIN_NORMAL;
   return tmp;
 }


        


More information about the libc-commits mailing list