[libc-commits] [libc] 2893aa5 - [libc][math] Fix -Wshadow warnings in cos.h (#196342)

via libc-commits libc-commits at lists.llvm.org
Sun May 10 11:38:58 PDT 2026


Author: Nico Weber
Date: 2026-05-10T14:38:53-04:00
New Revision: 2893aa5d1f31d62a8f1c50e202d7924004792f2b

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

LOG: [libc][math] Fix -Wshadow warnings in cos.h (#196342)

cos() does `using namespace range_reduction_double_internal;` and
range_reduction_double_internal after 51e9430a0c767 contains

    using LIBC_NAMESPACE::fputil::DoubleDouble;
    using Float128 = LIBC_NAMESPACE::fputil::DyadicFloat<128>;

So the local using statements for DoubleDouble and Float128 shadowed
these. Just remove the local using statements.

No behavior change.

Added: 
    

Modified: 
    libc/src/__support/math/cos.h

Removed: 
    


################################################################################
diff  --git a/libc/src/__support/math/cos.h b/libc/src/__support/math/cos.h
index 1a7833978304a..e6a37c132cd80 100644
--- a/libc/src/__support/math/cos.h
+++ b/libc/src/__support/math/cos.h
@@ -32,7 +32,6 @@ namespace math {
 
 LIBC_INLINE constexpr double cos(double x) {
   using namespace range_reduction_double_internal;
-  using DoubleDouble = fputil::DoubleDouble;
   using FPBits = typename fputil::FPBits<double>;
   FPBits xbits(x);
 
@@ -122,7 +121,6 @@ LIBC_INLINE constexpr double cos(double x) {
 #ifdef LIBC_MATH_HAS_SKIP_ACCURATE_PASS
   return rr.hi + rr.lo;
 #else
-  using Float128 = typename fputil::DyadicFloat<128>;
   double rlp = rr.lo + err;
   double rlm = rr.lo - err;
 


        


More information about the libc-commits mailing list