Collin Funk wrote:
> FreeBSD 15.0 was released today. I pushed the attached patch to
> maint-tools.git documenting that and the current minor versions for the
> 13.x and 14.x stable branches.

Thanks.

Building a testdir of all of Gnulib, I see two compilation errors:

c++ -ferror-limit=0 -DHAVE_CONFIG_H -DEXEEXT=\"\" -DEXEEXT=\"\" -I. 
-I../../gltests -I..   -DGNULIB_STRICT_CHECKING=1  -DIN_GNULIB_TESTS=1  -I. 
-I../../gltests  -I.. -I../../gltests/..  -I../gllib -I../../gltests/../gllib 
-I/home/bruno/include -I/usr/local/include -Wall -D_THREAD_SAFE -Wno-error 
-Wno-error -g -O2 -MT test-stddef-h-c++3.o -MD -MP -MF $depbase.Tpo -c -o 
test-stddef-h-c++3.o ../../gltests/test-stddef-h-c++3.cc && mv -f $depbase.Tpo 
$depbase.Po
In file included from ../../gltests/test-stddef-h-c++3.cc:22:
In file included from /usr/include/c++/v1/utility:284:
In file included from /usr/include/c++/v1/compare:174:
In file included from /usr/include/c++/v1/cmath:328:
../gllib/math.h:3024:46: error: declaration conflicts with target of using 
declaration already in scope
 3024 | _GL_MATH_CXX_REAL_FLOATING_DECL_2 (isfinite, isfinite, bool)
      |                                              ^
/usr/include/c++/v1/__math/traits.h:58:83: note: target of using declaration
   58 | _LIBCPP_NODISCARD inline _LIBCPP_CONSTEXPR_SINCE_CXX23 
_LIBCPP_HIDE_FROM_ABI bool isfinite(float __x) _NOEXCEPT {
      |                                                                         
          ^
/usr/include/c++/v1/math.h:419:20: note: using declaration
  419 | using std::__math::isfinite;
      |                    ^
...

The cause is a new 'using std::__math::isfinite;' statement in <c++/v1/math.h>,
added between clang 18 and 19: llvm commit 
6553608acac4e54bdbeae2eeacc5ba6bcefec05b.

This patch fixes it.


2025-12-02  Bruno Haible  <[email protected]>

        Fix compilation error in C++ mode on FreeBSD 15.
        * lib/math.in.h (isfinite): In C++ mode with clang >= 19, use the
        approach with C preprocessor macro.

diff --git a/lib/math.in.h b/lib/math.in.h
index ae9387dcc0..e456f02333 100644
--- a/lib/math.in.h
+++ b/lib/math.in.h
@@ -2467,7 +2467,7 @@ _GL_EXTERN_C int gl_isfinitel (long double x);
 #  if defined isfinite || defined GNULIB_NAMESPACE
 _GL_MATH_CXX_REAL_FLOATING_DECL_1 (isfinite)
 #   undef isfinite
-#   if __GNUC__ >= 6 || (defined __clang__ && !((defined __APPLE__ && defined 
__MACH__) || defined __FreeBSD__ || defined __OpenBSD__ || defined _AIX || 
(defined _WIN32 && !defined __CYGWIN__)))
+#   if __GNUC__ >= 6 || (defined __clang__ && (__clang_major__ >= 19 || 
!((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined 
__OpenBSD__ || defined _AIX || (defined _WIN32 && !defined __CYGWIN__))))
   /* This platform's <cmath> possibly defines isfinite through a set of inline
      functions.  */
 _GL_MATH_CXX_REAL_FLOATING_DECL_2 (isfinite, rpl_isfinite, bool)




Reply via email to