[libcxx-commits] [libcxx] [libc++] math: remove unused template (PR #91074)

Andrew Sukach via libcxx-commits libcxx-commits at lists.llvm.org
Sat May 4 10:21:19 PDT 2024


https://github.com/soukatch created https://github.com/llvm/llvm-project/pull/91074

Nothing huge. I noticed while reading through the code that the double overload for fabs has an unused template, so I removed it.

>From 9b63d892a01e4b5a3fd6ba72e66005b57670350c Mon Sep 17 00:00:00 2001
From: Andrew Sukach <andrewsukach at gmail.com>
Date: Sat, 4 May 2024 13:18:38 -0400
Subject: [PATCH] [libc++] math: remove unused template

---
 libcxx/include/__math/abs.h | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/libcxx/include/__math/abs.h b/libcxx/include/__math/abs.h
index ab82a2800f53c9..f3dfd711a1d5f9 100644
--- a/libcxx/include/__math/abs.h
+++ b/libcxx/include/__math/abs.h
@@ -25,10 +25,7 @@ namespace __math {
 
 _LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI float fabs(float __x) _NOEXCEPT { return __builtin_fabsf(__x); }
 
-template <class = int>
-_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI double fabs(double __x) _NOEXCEPT {
-  return __builtin_fabs(__x);
-}
+_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI double fabs(double __x) _NOEXCEPT { return __builtin_fabs(__x); }
 
 _LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI long double fabs(long double __x) _NOEXCEPT {
   return __builtin_fabsl(__x);



More information about the libcxx-commits mailing list