Skip to content

libc++ 21 doesn't compile with gcc 14, even though it should be supported #174203

@DimitryAndric

Description

@DimitryAndric

In 9e94043 libc++ 21 has been marked compatible with gcc 14 and higher. However, if I attempt to build libc++ from the release/21.x branch with gcc 14, I get lots of errors:

$ cmake -G Ninja -D CMAKE_C_COMPILER=gcc15 -D CMAKE_CXX_COMPILER=g++15 ~/src/llvm-project/libcxx
...
$ ninja -v
...
FAILED: [code=1] src/CMakeFiles/cxx_shared.dir/new_helpers.cpp.o 
/usr/local/bin/g++14 -DLIBCXXRT -DLIBC_NAMESPACE=__llvm_libc_common_utils -D_LIBCPP_BUILDING_LIBRARY -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES -I/share/dim/src/llvm/llvmorg-21.1.7-0-g292dc2b86f66/libcxx/src -I/home/dim/obj/libcxx-gcc14/include/c++/v1 -I/home/dim/obj/libcxx-gcc14/private-abi-headers -I/share/dim/src/llvm/llvmorg-21.1.7-0-g292dc2b86f66/cmake/Modules/../../libc -std=c++23 -fPIC -nostdinc++ -fvisibility-inlines-hidden -fvisibility=hidden -fsized-deallocation -Wall -Wextra -Wshadow -Wwrite-strings -Wno-unused-parameter -Wno-long-long -Werror=return-type -Wextra-semi -Wundef -Wformat-nonliteral -Wno-nullability-completeness -Wstrict-aliasing=2 -Wstrict-overflow=4 -Wno-attributes -Wno-literal-suffix -Wno-c++14-compat -Wno-noexcept-type -Wno-suggest-override -Wno-alloc-size-larger-than -Wno-deprecated-declarations -Wno-dangling-reference -Wno-strict-overflow -Wno-maybe-uninitialized -Wno-strict-aliasing -Wno-error -fdebug-prefix-map=/home/dim/obj/libcxx-gcc14/include/c++/v1=/share/dim/src/llvm/llvmorg-21.1.7-0-g292dc2b86f66/libcxx/include -MD -MT src/CMakeFiles/cxx_shared.dir/new_helpers.cpp.o -MF src/CMakeFiles/cxx_shared.dir/new_helpers.cpp.o.d -o src/CMakeFiles/cxx_shared.dir/new_helpers.cpp.o -c /share/dim/src/llvm/llvmorg-21.1.7-0-g292dc2b86f66/libcxx/src/new_helpers.cpp
In file included from /home/dim/obj/libcxx-gcc14/include/c++/v1/new:94,
                 from /share/dim/src/llvm/llvmorg-21.1.7-0-g292dc2b86f66/libcxx/src/new_helpers.cpp:10:
/home/dim/obj/libcxx-gcc14/include/c++/v1/__new/allocate.h: In function '_Tp* std::__1::__libcpp_allocate(__element_count, size_t)':
/home/dim/obj/libcxx-gcc14/include/c++/v1/__new/allocate.h:40:30: error: there are no arguments to '__builtin_operator_new' that depend on a template parameter, so a declaration of '__builtin_operator_new' must be available [-fpermissive]
   40 |     return static_cast<_Tp*>(__builtin_operator_new(__size, static_cast<align_val_t>(__align)));
      |                              ^~~~~~~~~~~~~~~~~~~~~~
/home/dim/obj/libcxx-gcc14/include/c++/v1/__new/allocate.h:40:30: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
/home/dim/obj/libcxx-gcc14/include/c++/v1/__new/allocate.h:43:28: error: there are no arguments to '__builtin_operator_new' that depend on a template parameter, so a declaration of '__builtin_operator_new' must be available [-fpermissive]
   43 |   return static_cast<_Tp*>(__builtin_operator_new(__size));
      |                            ^~~~~~~~~~~~~~~~~~~~~~
At global scope:
cc1plus: note: unrecognized command-line option '-Wno-nullability-completeness' may have been intended to silence earlier diagnostics
[ 88% 1711/1921] /usr/local/bin/g++14 -DLIBCXXRT -DLIBC_NAMESPACE=__llvm_libc_common_utils -D_LIBCPP_BUILDING_LIBRARY -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES -I/share/dim/src/llvm/llvmorg-21.1.7-0-g292dc2b86f66/libcxx/src -I/home/dim/obj/libcxx-gcc14/include/c++/v1 -I/home/dim/obj/libcxx-gcc14/private-abi-headers -I/share/dim/src/llvm/llvmorg-21.1.7-0-g292dc2b86f66/cmake/Modules/../../libc -std=c++23 -fPIC -nostdinc++ -fvisibility-inlines-hidden -fvisibility=hidden -fsized-deallocation -Wall -Wextra -Wshadow -Wwrite-strings -Wno-unused-parameter -Wno-long-long -Werror=return-type -Wextra-semi -Wundef -Wformat-nonliteral -Wno-nullability-completeness -Wstrict-aliasing=2 -Wstrict-overflow=4 -Wno-attributes -Wno-literal-suffix -Wno-c++14-compat -Wno-noexcept-type -Wno-suggest-override -Wno-alloc-size-larger-than -Wno-deprecated-declarations -Wno-dangling-reference -Wno-strict-overflow -Wno-maybe-uninitialized -Wno-strict-aliasing -Wno-error -fdebug-prefix-map=/home/dim/obj/libcxx-gcc14/include/c++/v1=/share/dim/src/llvm/llvmorg-21.1.7-0-g292dc2b86f66/libcxx/include -MD -MT src/CMakeFiles/cxx_shared.dir/any.cpp.o -MF src/CMakeFiles/cxx_shared.dir/any.cpp.o.d -o src/CMakeFiles/cxx_shared.dir/any.cpp.o -c /share/dim/src/llvm/llvmorg-21.1.7-0-g292dc2b86f66/libcxx/src/any.cpp
FAILED: [code=1] src/CMakeFiles/cxx_shared.dir/any.cpp.o 
/usr/local/bin/g++14 -DLIBCXXRT -DLIBC_NAMESPACE=__llvm_libc_common_utils -D_LIBCPP_BUILDING_LIBRARY -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES -I/share/dim/src/llvm/llvmorg-21.1.7-0-g292dc2b86f66/libcxx/src -I/home/dim/obj/libcxx-gcc14/include/c++/v1 -I/home/dim/obj/libcxx-gcc14/private-abi-headers -I/share/dim/src/llvm/llvmorg-21.1.7-0-g292dc2b86f66/cmake/Modules/../../libc -std=c++23 -fPIC -nostdinc++ -fvisibility-inlines-hidden -fvisibility=hidden -fsized-deallocation -Wall -Wextra -Wshadow -Wwrite-strings -Wno-unused-parameter -Wno-long-long -Werror=return-type -Wextra-semi -Wundef -Wformat-nonliteral -Wno-nullability-completeness -Wstrict-aliasing=2 -Wstrict-overflow=4 -Wno-attributes -Wno-literal-suffix -Wno-c++14-compat -Wno-noexcept-type -Wno-suggest-override -Wno-alloc-size-larger-than -Wno-deprecated-declarations -Wno-dangling-reference -Wno-strict-overflow -Wno-maybe-uninitialized -Wno-strict-aliasing -Wno-error -fdebug-prefix-map=/home/dim/obj/libcxx-gcc14/include/c++/v1=/share/dim/src/llvm/llvmorg-21.1.7-0-g292dc2b86f66/libcxx/include -MD -MT src/CMakeFiles/cxx_shared.dir/any.cpp.o -MF src/CMakeFiles/cxx_shared.dir/any.cpp.o.d -o src/CMakeFiles/cxx_shared.dir/any.cpp.o -c /share/dim/src/llvm/llvmorg-21.1.7-0-g292dc2b86f66/libcxx/src/any.cpp
In file included from /home/dim/obj/libcxx-gcc14/include/c++/v1/__memory/pointer_traits.h:18,
                 from /home/dim/obj/libcxx-gcc14/include/c++/v1/__memory/allocator_traits.h:17,
                 from /home/dim/obj/libcxx-gcc14/include/c++/v1/__memory/allocate_at_least.h:14,
                 from /home/dim/obj/libcxx-gcc14/include/c++/v1/__memory/allocator.h:17,
                 from /home/dim/obj/libcxx-gcc14/include/c++/v1/any:87,
                 from /share/dim/src/llvm/llvmorg-21.1.7-0-g292dc2b86f66/libcxx/src/any.cpp:9:
/home/dim/obj/libcxx-gcc14/include/c++/v1/__type_traits/decay.h:22:32: error: expected type-specifier before '__decay'
   22 |   using type _LIBCPP_NODEBUG = __decay(_Tp);
      |                                ^~~~~~~
In file included from /home/dim/obj/libcxx-gcc14/include/c++/v1/__type_traits/is_constructible.h:13,
                 from /home/dim/obj/libcxx-gcc14/include/c++/v1/__memory/allocator_traits.h:20:
/home/dim/obj/libcxx-gcc14/include/c++/v1/__type_traits/add_reference.h:22:32: error: expected type-specifier before '__add_lvalue_reference'
   22 |   using type _LIBCPP_NODEBUG = __add_lvalue_reference(_Tp);
      |                                ^~~~~~~~~~~~~~~~~~~~~~
/home/dim/obj/libcxx-gcc14/include/c++/v1/__type_traits/add_reference.h:40:32: error: expected type-specifier before '__add_rvalue_reference'
   40 |   using type _LIBCPP_NODEBUG = __add_rvalue_reference(_Tp);
      |                                ^~~~~~~~~~~~~~~~~~~~~~
In file included from /home/dim/obj/libcxx-gcc14/include/c++/v1/__memory/allocator.h:19:
/home/dim/obj/libcxx-gcc14/include/c++/v1/__new/allocate.h: In function '_Tp* std::__1::__libcpp_allocate(__element_count, size_t)':
/home/dim/obj/libcxx-gcc14/include/c++/v1/__new/allocate.h:40:30: error: there are no arguments to '__builtin_operator_new' that depend on a template parameter, so a declaration of '__builtin_operator_new' must be available [-fpermissive]
   40 |     return static_cast<_Tp*>(__builtin_operator_new(__size, static_cast<align_val_t>(__align)));
      |                              ^~~~~~~~~~~~~~~~~~~~~~
/home/dim/obj/libcxx-gcc14/include/c++/v1/__new/allocate.h:40:30: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
/home/dim/obj/libcxx-gcc14/include/c++/v1/__new/allocate.h:43:28: error: there are no arguments to '__builtin_operator_new' that depend on a template parameter, so a declaration of '__builtin_operator_new' must be available [-fpermissive]
   43 |   return static_cast<_Tp*>(__builtin_operator_new(__size));
      |                            ^~~~~~~~~~~~~~~~~~~~~~
In file included from /home/dim/obj/libcxx-gcc14/include/c++/v1/__memory/allocator.h:21:
/home/dim/obj/libcxx-gcc14/include/c++/v1/__type_traits/is_const.h: At global scope:
/home/dim/obj/libcxx-gcc14/include/c++/v1/__type_traits/is_const.h:22:60: error: there are no arguments to '__is_const' that depend on a template parameter, so a declaration of '__is_const' must be available [-fpermissive]
   22 | struct _LIBCPP_NO_SPECIALIZATIONS is_const : _BoolConstant<__is_const(_Tp)> {};
      |                                                            ^~~~~~~~~~
/home/dim/obj/libcxx-gcc14/include/c++/v1/__type_traits/is_const.h:22:75: error: template argument 1 is invalid
   22 | struct _LIBCPP_NO_SPECIALIZATIONS is_const : _BoolConstant<__is_const(_Tp)> {};
      |                                                                           ^
/home/dim/obj/libcxx-gcc14/include/c++/v1/__type_traits/is_const.h:26:77: error: expected primary-expression before ')' token
   26 | _LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_const_v = __is_const(_Tp);
      |                                                                             ^
/home/dim/obj/libcxx-gcc14/include/c++/v1/__type_traits/is_const.h:26:63: error: there are no arguments to '__is_const' that depend on a template parameter, so a declaration of '__is_const' must be available [-fpermissive]
   26 | _LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_const_v = __is_const(_Tp);
      |                                                               ^~~~~~~~~~
In file included from /home/dim/obj/libcxx-gcc14/include/c++/v1/__memory/allocator.h:25:
/home/dim/obj/libcxx-gcc14/include/c++/v1/__type_traits/is_volatile.h:22:63: error: there are no arguments to '__is_volatile' that depend on a template parameter, so a declaration of '__is_volatile' must be available [-fpermissive]
   22 | struct _LIBCPP_NO_SPECIALIZATIONS is_volatile : _BoolConstant<__is_volatile(_Tp)> {};
      |                                                               ^~~~~~~~~~~~~
/home/dim/obj/libcxx-gcc14/include/c++/v1/__type_traits/is_volatile.h:22:81: error: template argument 1 is invalid
   22 | struct _LIBCPP_NO_SPECIALIZATIONS is_volatile : _BoolConstant<__is_volatile(_Tp)> {};
      |                                                                                 ^
/home/dim/obj/libcxx-gcc14/include/c++/v1/__type_traits/is_volatile.h:26:83: error: expected primary-expression before ')' token
   26 | _LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_volatile_v = __is_volatile(_Tp);
      |                                                                                   ^
/home/dim/obj/libcxx-gcc14/include/c++/v1/__type_traits/is_volatile.h:26:66: error: there are no arguments to '__is_volatile' that depend on a template parameter, so a declaration of '__is_volatile' must be available [-fpermissive]
   26 | _LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_volatile_v = __is_volatile(_Tp);
      |                                                                  ^~~~~~~~~~~~~
In file included from /home/dim/obj/libcxx-gcc14/include/c++/v1/__type_traits/common_reference.h:13,
                 from /home/dim/obj/libcxx-gcc14/include/c++/v1/__concepts/common_reference_with.h:15,
                 from /home/dim/obj/libcxx-gcc14/include/c++/v1/__compare/three_way_comparable.h:14,
                 from /home/dim/obj/libcxx-gcc14/include/c++/v1/__compare/compare_three_way.h:13,
                 from /home/dim/obj/libcxx-gcc14/include/c++/v1/__memory/unique_ptr.h:14,
                 from /home/dim/obj/libcxx-gcc14/include/c++/v1/any:90:
/home/dim/obj/libcxx-gcc14/include/c++/v1/__type_traits/add_pointer.h:27:32: error: expected type-specifier before '__add_pointer'
   27 |   using type _LIBCPP_NODEBUG = __add_pointer(_Tp);
      |                                ^~~~~~~~~~~~~
In file included from /home/dim/obj/libcxx-gcc14/include/c++/v1/__type_traits/is_destructible.h:16,
                 from /home/dim/obj/libcxx-gcc14/include/c++/v1/__type_traits/is_trivially_destructible.h:14,
                 from /home/dim/obj/libcxx-gcc14/include/c++/v1/__memory/array_cookie.h:18,
                 from /home/dim/obj/libcxx-gcc14/include/c++/v1/__memory/unique_ptr.h:23:
/home/dim/obj/libcxx-gcc14/include/c++/v1/__type_traits/remove_all_extents.h:22:32: error: expected type-specifier before '__remove_all_extents'
   22 |   using type _LIBCPP_NODEBUG = __remove_all_extents(_Tp);
      |                                ^~~~~~~~~~~~~~~~~~~~
In file included from /home/dim/obj/libcxx-gcc14/include/c++/v1/__memory/unique_ptr.h:40:
/home/dim/obj/libcxx-gcc14/include/c++/v1/__type_traits/is_pointer.h:22:62: error: there are no arguments to '__is_pointer' that depend on a template parameter, so a declaration of '__is_pointer' must be available [-fpermissive]
   22 | struct _LIBCPP_NO_SPECIALIZATIONS is_pointer : _BoolConstant<__is_pointer(_Tp)> {};
      |                                                              ^~~~~~~~~~~~
/home/dim/obj/libcxx-gcc14/include/c++/v1/__type_traits/is_pointer.h:22:79: error: template argument 1 is invalid
   22 | struct _LIBCPP_NO_SPECIALIZATIONS is_pointer : _BoolConstant<__is_pointer(_Tp)> {};
      |                                                                               ^
/home/dim/obj/libcxx-gcc14/include/c++/v1/__type_traits/is_pointer.h:26:81: error: expected primary-expression before ')' token
   26 | _LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_pointer_v = __is_pointer(_Tp);
      |                                                                                 ^
/home/dim/obj/libcxx-gcc14/include/c++/v1/__type_traits/is_pointer.h:26:65: error: there are no arguments to '__is_pointer' that depend on a template parameter, so a declaration of '__is_pointer' must be available [-fpermissive]
   26 | _LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_pointer_v = __is_pointer(_Tp);
      |                                                                 ^~~~~~~~~~~~
In file included from /home/dim/obj/libcxx-gcc14/include/c++/v1/__memory/unique_ptr.h:48:
/home/dim/obj/libcxx-gcc14/include/c++/v1/__type_traits/remove_extent.h:22:32: error: expected type-specifier before '__remove_extent'
   22 |   using type _LIBCPP_NODEBUG = __remove_extent(_Tp);
      |                                ^~~~~~~~~~~~~~~
/home/dim/obj/libcxx-gcc14/include/c++/v1/__type_traits/is_constructible.h: In instantiation of 'struct std::__1::is_move_constructible<std::__1::__unique_ptr_array_bounds_stateless>':
/home/dim/obj/libcxx-gcc14/include/c++/v1/__type_traits/is_swappable.h:45:47:   required by substitution of 'template<class _Tp> using std::__1::__swap_result_t = std::__1::__enable_if_t<((bool)(std::__1::is_move_constructible<_Tp>::value && std::__1::is_move_assignable<_Tp>::value))> [with _Tp = std::__1::__unique_ptr_array_bounds_stateless]'
   45 |     __enable_if_t<is_move_constructible<_Tp>::value && is_move_assignable<_Tp>::value>;
      |                                               ^~~~~
/home/dim/obj/libcxx-gcc14/include/c++/v1/__utility/swap.h:41:81:   required by substitution of 'template<class _Tp> constexpr std::__1::__swap_result_t<_Tp> std::__1::swap(_Tp&, _Tp&) [with _Tp = std::__1::__unique_ptr_array_bounds_stateless]'
   41 | inline _LIBCPP_HIDE_FROM_ABI __swap_result_t<_Tp> _LIBCPP_CONSTEXPR_SINCE_CXX20 swap(_Tp& __x, _Tp& __y)
      |                                                                                 ^~~~
/home/dim/obj/libcxx-gcc14/include/c++/v1/__memory/unique_ptr.h:625:9:   required from here
  625 |     swap(__checker_, __u.__checker_);
      |     ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dim/obj/libcxx-gcc14/include/c++/v1/__type_traits/is_constructible.h:41:31: error: no type named 'type' in 'struct std::__1::add_rvalue_reference<std::__1::__unique_ptr_array_bounds_stateless>'
   41 |     : integral_constant<bool, __is_constructible(_Tp, __add_rvalue_reference_t<_Tp>)> {};
      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/dim/obj/libcxx-gcc14/include/c++/v1/__utility/pair.h:29,
                 from /home/dim/obj/libcxx-gcc14/include/c++/v1/__functional/hash.h:26,
                 from /home/dim/obj/libcxx-gcc14/include/c++/v1/__memory/unique_ptr.h:20:
/home/dim/obj/libcxx-gcc14/include/c++/v1/__type_traits/is_assignable.h: In instantiation of 'struct std::__1::is_move_assignable<std::__1::__unique_ptr_array_bounds_stateless>':
/home/dim/obj/libcxx-gcc14/include/c++/v1/__type_traits/is_swappable.h:45:81:   required by substitution of 'template<class _Tp> using std::__1::__swap_result_t = std::__1::__enable_if_t<((bool)(std::__1::is_move_constructible<_Tp>::value && std::__1::is_move_assignable<_Tp>::value))> [with _Tp = std::__1::__unique_ptr_array_bounds_stateless]'
   45 |     __enable_if_t<is_move_constructible<_Tp>::value && is_move_assignable<_Tp>::value>;
      |                                                                                 ^~~~~
/home/dim/obj/libcxx-gcc14/include/c++/v1/__utility/swap.h:41:81:   required by substitution of 'template<class _Tp> constexpr std::__1::__swap_result_t<_Tp> std::__1::swap(_Tp&, _Tp&) [with _Tp = std::__1::__unique_ptr_array_bounds_stateless]'
   41 | inline _LIBCPP_HIDE_FROM_ABI __swap_result_t<_Tp> _LIBCPP_CONSTEXPR_SINCE_CXX20 swap(_Tp& __x, _Tp& __y)
      |                                                                                 ^~~~
/home/dim/obj/libcxx-gcc14/include/c++/v1/__memory/unique_ptr.h:625:9:   required from here
  625 |     swap(__checker_, __u.__checker_);
      |     ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dim/obj/libcxx-gcc14/include/c++/v1/__type_traits/is_assignable.h:41:31: error: no type named 'type' in 'struct std::__1::add_lvalue_reference<std::__1::__unique_ptr_array_bounds_stateless>'
   41 |     : integral_constant<bool, __is_assignable(__add_lvalue_reference_t<_Tp>, __add_rvalue_reference_t<_Tp>)> {};
      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dim/obj/libcxx-gcc14/include/c++/v1/__type_traits/is_assignable.h:41:31: error: no type named 'type' in 'struct std::__1::add_rvalue_reference<std::__1::__unique_ptr_array_bounds_stateless>'
/home/dim/obj/libcxx-gcc14/include/c++/v1/__memory/unique_ptr.h: In member function 'constexpr void std::__1::unique_ptr<_Tp [], _Dp>::swap(std::__1::unique_ptr<_Tp [], _Dp>&)':
/home/dim/obj/libcxx-gcc14/include/c++/v1/__memory/unique_ptr.h:625:9: error: no matching function for call to 'swap(std::__1::unique_ptr<_Tp [], _Dp>::_BoundsChecker&, std::__1::unique_ptr<_Tp [], _Dp>::_BoundsChecker&)'
  625 |     swap(__checker_, __u.__checker_);
      |     ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dim/obj/libcxx-gcc14/include/c++/v1/__utility/pair.h:543:1: note: candidate: 'template<class _T1, class _T2>  requires (__is_swappable_v<const _T1>) && (__is_swappable_v<const _T2>) constexpr void std::__1::swap(const pair<_Type1, _Type2>&, const pair<_Type1, _Type2>&)'
  543 | swap(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) noexcept(noexcept(__x.swap(__y))) {
      | ^~~~
/home/dim/obj/libcxx-gcc14/include/c++/v1/__utility/pair.h:543:1: note:   template argument deduction/substitution failed:
/home/dim/obj/libcxx-gcc14/include/c++/v1/__memory/unique_ptr.h:625:9: note:   'std::__1::unique_ptr<_Tp [], _Dp>::_BoundsChecker' {aka 'std::__1::__unique_ptr_array_bounds_stateless'} is not derived from 'const std::__1::pair<_Type1, _Type2>'
  625 |     swap(__checker_, __u.__checker_);
      |     ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dim/obj/libcxx-gcc14/include/c++/v1/__utility/pair.h:534:65: note: candidate: 'template<class _T1, class _T2, typename std::__1::enable_if<(__is_swappable_v<_T1> && __is_swappable_v<_T2>), int>::type <anonymous> > constexpr void std::__1::swap(pair<_Type1, _Type2>&, pair<_Type1, _Type2>&)'
  534 | inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)
      |                                                                 ^~~~
/home/dim/obj/libcxx-gcc14/include/c++/v1/__utility/pair.h:534:65: note:   template argument deduction/substitution failed:
/home/dim/obj/libcxx-gcc14/include/c++/v1/__memory/unique_ptr.h:625:9: note:   'std::__1::unique_ptr<_Tp [], _Dp>::_BoundsChecker' {aka 'std::__1::__unique_ptr_array_bounds_stateless'} is not derived from 'std::__1::pair<_Type1, _Type2>'
  625 |     swap(__checker_, __u.__checker_);
      |     ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/dim/obj/libcxx-gcc14/include/c++/v1/__functional/hash.h:27:
/home/dim/obj/libcxx-gcc14/include/c++/v1/__utility/swap.h:49:65: note: candidate: 'template<class _Tp, long unsigned int _Np, typename std::__1::enable_if<__is_swappable_v<_Tp>, int>::type <anonymous> > constexpr void std::__1::swap(_Tp (&)[_Np], _Tp (&)[_Np])'
   49 | inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void swap(_Tp (&__a)[_Np], _Tp (&__b)[_Np])
      |                                                                 ^~~~
/home/dim/obj/libcxx-gcc14/include/c++/v1/__utility/swap.h:49:65: note:   template argument deduction/substitution failed:
/home/dim/obj/libcxx-gcc14/include/c++/v1/__memory/unique_ptr.h:625:9: note:   mismatched types '_Tp [_Np]' and 'std::__1::unique_ptr<_Tp [], _Dp>::_BoundsChecker' {aka 'std::__1::__unique_ptr_array_bounds_stateless'}
  625 |     swap(__checker_, __u.__checker_);
      |     ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dim/obj/libcxx-gcc14/include/c++/v1/__utility/swap.h:41:81: note: candidate: 'template<class _Tp> constexpr std::__1::__swap_result_t<_Tp> std::__1::swap(_Tp&, _Tp&)'
   41 | inline _LIBCPP_HIDE_FROM_ABI __swap_result_t<_Tp> _LIBCPP_CONSTEXPR_SINCE_CXX20 swap(_Tp& __x, _Tp& __y)
      |                                                                                 ^~~~
/home/dim/obj/libcxx-gcc14/include/c++/v1/__utility/swap.h:41:81: note:   substitution of deduced template arguments resulted in errors seen above
At global scope:
cc1plus: note: unrecognized command-line option '-Wno-nullability-completeness' may have been intended to silence earlier diagnostics
[...many more errors...]

It looks like several gcc-14-busting commits were merged from main to release/21.x, even though the libcxx/include/__configuration/compiler.h check was not adjusted. Either those commits should be reverted, or the version check should be bumped?

Metadata

Metadata

Assignees

No one assigned

    Labels

    build-problemlibc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions