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

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Tue Sep 2 18:14:48 PDT 2025


================
@@ -97,13 +97,19 @@ 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 _LIBCPP_GLIBC_PREREQ(2, 8) || defined(__LLVM_LIBC__)
+#  define _LIBCPP_LGAMMA_R_NOEXCEPT _NOEXCEPT
+else
----------------
frederick-vs-ja wrote:

```suggestion
#else
```

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


More information about the libcxx-commits mailing list