[libcxx-commits] [libcxx] [libc++] Conditionally declare `lgamma_r` as noexcept (PR #156547)

Nico Weber via libcxx-commits libcxx-commits at lists.llvm.org
Tue Sep 9 06:28:20 PDT 2025


================
@@ -97,13 +97,23 @@ class binomial_distribution {
   }
 };
 
-// The LLVM C library provides this with conflicting `noexcept` attributes.
-#if !defined(_LIBCPP_MSVCRT_LIKE) && !defined(__LLVM_LIBC__)
-extern "C" double lgamma_r(double, int*);
+// Some libc declares the math functions to be `noexcept`.
+#if defined(_LIBCPP_GLIBC_PREREQ)
+#  if _LIBCPP_GLIBC_PREREQ(2, 8)
+#    define _LIBCPP_LGAMMA_R_NOEXCEPT _NOEXCEPT
+#  endif
----------------
nico wrote:

#157610 added it. Thanks!

https://github.com/llvm/llvm-project/pull/156547


More information about the libcxx-commits mailing list