https://gcc.gnu.org/g:a9f669055c2bf080a7773d4516ac869dc1f2564b

commit r17-5789-ga9f669055c2bf080a7773d4516ac869dc1f2564b
Author: Kael Andrew Franco <[email protected]>
Date:   Sun Nov 1 17:33:00 2026 -0500

    gcc: Remove HAVE_SWAP_IN_UTILITY in gcc/configure.ac. [PR112422]
    
    GCC itself needs C++14 and std::swap was move to <utility>
    in C++11.
    
    Bootstrapped on x86_64-pc-linux-gnu.
    
            PR bootstrap/112422
    
    gcc/ChangeLog:
    
            * configure.ac (HAVE_SWAP_IN_UTILITY): Remove.
            * configure: Regenerate.
            * config.in: Regenerate.
            * system.h: Remove HAVE_SWAP_IN_UTILITY.

Diff:
---
 gcc/config.in    |  6 ------
 gcc/configure    | 38 ++------------------------------------
 gcc/configure.ac |  9 ---------
 gcc/system.h     |  2 +-
 4 files changed, 3 insertions(+), 52 deletions(-)

diff --git a/gcc/config.in b/gcc/config.in
index 1027a45a207b..241c299682d0 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -1964,12 +1964,6 @@
 #endif
 
 
-/* Define if <utility> defines std::swap. */
-#ifndef USED_FOR_TARGET
-#undef HAVE_SWAP_IN_UTILITY
-#endif
-
-
 /* Define to 1 if you have the `sysconf' function. */
 #ifndef USED_FOR_TARGET
 #undef HAVE_SYSCONF
diff --git a/gcc/configure b/gcc/configure
index 14c9b39d9cec..a60ae0ffbcc9 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -7065,40 +7065,6 @@ fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for std::swap in <utility>" 
>&5
-$as_echo_n "checking for std::swap in <utility>... " >&6; }
-if ${ac_cv_std_swap_in_utility+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#include <utility>
-
-int
-main ()
-{
-int a, b; std::swap(a,b);
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-  ac_cv_std_swap_in_utility=yes
-else
-  ac_cv_std_swap_in_utility=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_std_swap_in_utility" 
>&5
-$as_echo "$ac_cv_std_swap_in_utility" >&6; }
-if test $ac_cv_std_swap_in_utility = yes; then
-
-$as_echo "#define HAVE_SWAP_IN_UTILITY 1" >>confdefs.h
-
-fi
-
 # ---------------------
 # Warnings and checking
 # ---------------------
@@ -22088,7 +22054,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 22091 "configure"
+#line 22057 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -22194,7 +22160,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 22197 "configure"
+#line 22163 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 06b23d6de419..cc0d00e911be 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -552,15 +552,6 @@ struct X<long long> { typedef long long t; };
 ]], [[X<int64_t>::t x;]])],[],[AC_MSG_ERROR([error verifying int64_t uses long 
long])])
 fi
 
-AC_CACHE_CHECK(for std::swap in <utility>, ac_cv_std_swap_in_utility, [
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#include <utility>
-]], [[int a, b; 
std::swap(a,b);]])],[ac_cv_std_swap_in_utility=yes],[ac_cv_std_swap_in_utility=no])])
-if test $ac_cv_std_swap_in_utility = yes; then
-  AC_DEFINE(HAVE_SWAP_IN_UTILITY, 1,
-  [Define if <utility> defines std::swap.])
-fi
-
 # ---------------------
 # Warnings and checking
 # ---------------------
diff --git a/gcc/system.h b/gcc/system.h
index b967c5677fa0..6a05e6dc88fc 100644
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -203,7 +203,7 @@ extern int fprintf_unlocked (FILE *, const char *, ...);
    poisoning the ctype macros through safe-ctype.h */
 
 #ifdef __cplusplus
-#if defined (INCLUDE_ALGORITHM) || !defined (HAVE_SWAP_IN_UTILITY)
+#ifdef INCLUDE_ALGORITHM
 # include <algorithm>
 #endif
 #ifdef INCLUDE_DEQUE

Reply via email to