Skip to content

Commit 03c8a83

Browse files
authored
[libc++] Address most LLVM23 TODOs (llvm#199397)
There is still one LLVM23 TODO left that can only be resolved once we update GCC.
1 parent 50a110a commit 03c8a83

3 files changed

Lines changed: 3 additions & 35 deletions

File tree

libcxx/include/__configuration/hardening.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,6 @@
1717
# pragma GCC system_header
1818
#endif
1919

20-
// TODO(LLVM 23): Remove this. We're making these an error to catch folks who might not have migrated.
21-
// Since hardening went through several changes (many of which impacted user-facing macros),
22-
// we're keeping these checks around for a bit longer than usual. Failure to properly configure
23-
// hardening results in checks being dropped silently, which is a pretty big deal.
24-
#if defined(_LIBCPP_ENABLE_ASSERTIONS)
25-
# error "_LIBCPP_ENABLE_ASSERTIONS has been removed, please use _LIBCPP_HARDENING_MODE=<mode> instead (see docs)"
26-
#endif
27-
#if defined(_LIBCPP_ENABLE_HARDENED_MODE)
28-
# error "_LIBCPP_ENABLE_HARDENED_MODE has been removed, please use _LIBCPP_HARDENING_MODE=<mode> instead (see docs)"
29-
#endif
30-
#if defined(_LIBCPP_ENABLE_SAFE_MODE)
31-
# error "_LIBCPP_ENABLE_SAFE_MODE has been removed, please use _LIBCPP_HARDENING_MODE=<mode> instead (see docs)"
32-
#endif
33-
#if defined(_LIBCPP_ENABLE_DEBUG_MODE)
34-
# error "_LIBCPP_ENABLE_DEBUG_MODE has been removed, please use _LIBCPP_HARDENING_MODE=<mode> instead (see docs)"
35-
#endif
36-
3720
// The library provides the macro `_LIBCPP_HARDENING_MODE` which can be set to one of the following values:
3821
//
3922
// - `_LIBCPP_HARDENING_MODE_NONE`;

libcxx/include/string

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -940,12 +940,7 @@ public:
940940

941941
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string()
942942
_NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
943-
# if _LIBCPP_STD_VER >= 20 // TODO(LLVM 23): Remove this condition; this is a workaround for https://llvm.org/PR154567
944-
: __rep_(__short())
945-
# else
946-
: __rep_()
947-
# endif
948-
{
943+
: __rep_() {
949944
__annotate_new(0);
950945
}
951946

@@ -955,12 +950,7 @@ public:
955950
# else
956951
_NOEXCEPT
957952
# endif
958-
# if _LIBCPP_STD_VER >= 20 // TODO(LLVM 23): Remove this condition; this is a workaround for https://llvm.org/PR154567
959-
: __rep_(__short()),
960-
# else
961-
: __rep_(),
962-
# endif
963-
__alloc_(__a) {
953+
: __rep_(), __alloc_(__a) {
964954
__annotate_new(0);
965955
}
966956

libcxx/include/tuple

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -300,10 +300,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool __tuple_compare_equal(c
300300
template <class _Tp, class _Up, class _IndexSeq = make_index_sequence<tuple_size_v<_Tp>>>
301301
inline constexpr bool __can_tuple_compare_equal = false;
302302

303-
// TODO(LLVM 23): Remove `tuple_size_v<_Tp> == tuple_size_v<_Up>` here once once LLVM-20 support ends
304-
// because the resolution of CWG2369 landed in LLVM-21.
305303
template <class _Tp, class _Up, size_t... _Is>
306-
requires(tuple_size_v<_Tp> == tuple_size_v<_Up>)
307304
inline constexpr bool __can_tuple_compare_equal<_Tp, _Up, index_sequence<_Is...>> =
308305
__all<requires(const tuple_element_t<_Is, _Tp>& __t, const tuple_element_t<_Is, _Up>& __u) {
309306
{ __t == __u } -> __boolean_testable;
@@ -327,10 +324,8 @@ concept __tuple_like_no_tuple = __tuple_like<_Tp> && !__is_tuple_v<_Tp>;
327324
template <class _Tp, class _Up, class _IndexSeq>
328325
struct __tuple_common_comparison_category_impl {};
329326

330-
// TODO(LLVM 23): Remove `tuple_size_v<_Tp> == tuple_size_v<_Up>` here once once LLVM-20 support ends
331-
// because the resolution of CWG2369 landed in LLVM-21.
332327
template <class _Tp, class _Up, size_t... _Is>
333-
requires(tuple_size_v<_Tp> == tuple_size_v<_Up>) && requires {
328+
requires requires {
334329
typename common_comparison_category_t<
335330
__synth_three_way_result<tuple_element_t<_Is, _Tp>, tuple_element_t<_Is, _Up>>...>;
336331
}

0 commit comments

Comments
 (0)