Skip to content

Commit 22a3dae

Browse files
committed
[libc++] Removes Clang-18 specific code.
Clang-18 is no longer supported, so it's safe to remove its work-arounds.
1 parent 1657331 commit 22a3dae

File tree

27 files changed

+25
-69
lines changed

27 files changed

+25
-69
lines changed

libcxx/include/__config

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,14 +1213,6 @@ typedef __char32_t char32_t;
12131213
# define _LIBCPP_DIAGNOSE_NULLPTR
12141214
# endif
12151215

1216-
// TODO(LLVM 22): Remove this macro once LLVM19 support ends. __cpp_explicit_this_parameter has been set in LLVM20.
1217-
// Clang-18 has support for deducing this, but it does not set the FTM.
1218-
# if defined(__cpp_explicit_this_parameter) || (defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER >= 1800)
1219-
# define _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER 1
1220-
# else
1221-
# define _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER 0
1222-
# endif
1223-
12241216
#endif // __cplusplus
12251217

12261218
#endif // _LIBCPP___CONFIG

libcxx/include/__cxx03/__config

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1218,8 +1218,7 @@ typedef __char32_t char32_t;
12181218
# define _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
12191219
# endif
12201220

1221-
// Clang-18 has support for deducing this, but it does not set the FTM.
1222-
# if defined(__cpp_explicit_this_parameter) || (defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER >= 1800)
1221+
# if defined(__cpp_explicit_this_parameter)
12231222
# define _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER
12241223
# endif
12251224

libcxx/include/__format/format_arg.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ _LIBCPP_HIDE_FROM_ABI decltype(auto) __visit_format_arg(_Visitor&& __vis, basic_
149149
__libcpp_unreachable();
150150
}
151151

152-
# if _LIBCPP_STD_VER >= 26 && _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER
152+
# if _LIBCPP_STD_VER >= 26
153153

154154
template <class _Rp, class _Visitor, class _Context>
155155
_LIBCPP_HIDE_FROM_ABI _Rp __visit_format_arg(_Visitor&& __vis, basic_format_arg<_Context> __arg) {
@@ -200,7 +200,7 @@ _LIBCPP_HIDE_FROM_ABI _Rp __visit_format_arg(_Visitor&& __vis, basic_format_arg<
200200
__libcpp_unreachable();
201201
}
202202

203-
# endif // _LIBCPP_STD_VER >= 26 && _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER
203+
# endif // _LIBCPP_STD_VER >= 26
204204

205205
/// Contains the values used in basic_format_arg.
206206
///
@@ -285,7 +285,7 @@ class _LIBCPP_TEMPLATE_VIS _LIBCPP_NO_SPECIALIZATIONS basic_format_arg {
285285

286286
_LIBCPP_HIDE_FROM_ABI explicit operator bool() const noexcept { return __type_ != __format::__arg_t::__none; }
287287

288-
# if _LIBCPP_STD_VER >= 26 && _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER
288+
# if _LIBCPP_STD_VER >= 26
289289

290290
// This function is user facing, so it must wrap the non-standard types of
291291
// the "variant" in a handle to stay conforming. See __arg_t for more details.
@@ -329,7 +329,7 @@ class _LIBCPP_TEMPLATE_VIS _LIBCPP_NO_SPECIALIZATIONS basic_format_arg {
329329
}
330330
}
331331

332-
# endif // _LIBCPP_STD_VER >= 26 && _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER
332+
# endif // _LIBCPP_STD_VER >= 26
333333

334334
private:
335335
using char_type = typename _Context::char_type;
@@ -371,7 +371,7 @@ class _LIBCPP_TEMPLATE_VIS basic_format_arg<_Context>::handle {
371371
// This function is user facing, so it must wrap the non-standard types of
372372
// the "variant" in a handle to stay conforming. See __arg_t for more details.
373373
template <class _Visitor, class _Context>
374-
# if _LIBCPP_STD_VER >= 26 && _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER
374+
# if _LIBCPP_STD_VER >= 26
375375
_LIBCPP_DEPRECATED_IN_CXX26
376376
# endif
377377
_LIBCPP_HIDE_FROM_ABI decltype(auto)
@@ -387,7 +387,7 @@ _LIBCPP_DEPRECATED_IN_CXX26
387387
typename __basic_format_arg_value<_Context>::__handle __h{__arg.__value_.__u128_};
388388
return std::invoke(std::forward<_Visitor>(__vis), typename basic_format_arg<_Context>::handle{__h});
389389
}
390-
# endif // _LIBCPP_STD_VER >= 26 && _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER
390+
# endif // _LIBCPP_STD_VER >= 26
391391
default:
392392
return std::__visit_format_arg(std::forward<_Visitor>(__vis), __arg);
393393
}

libcxx/include/__format/format_context.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,13 +180,13 @@ class _LIBCPP_TEMPLATE_VIS basic_format_context<typename __format::__retarget_bu
180180
__format::__determine_arg_t<basic_format_context, decltype(__arg)>(),
181181
__basic_format_arg_value<basic_format_context>(__arg)};
182182
};
183-
# if _LIBCPP_STD_VER >= 26 && _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER
183+
# if _LIBCPP_STD_VER >= 26
184184
return static_cast<_Context*>(__c)->arg(__id).visit(std::move(__visitor));
185185
# else
186186
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
187187
return std::visit_format_arg(std::move(__visitor), static_cast<_Context*>(__c)->arg(__id));
188188
_LIBCPP_SUPPRESS_DEPRECATED_POP
189-
# endif // _LIBCPP_STD_VER >= 26 && _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER
189+
# endif // _LIBCPP_STD_VER >= 26
190190
}) {
191191
}
192192

libcxx/include/variant

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,7 +1302,7 @@ public:
13021302
__impl_.__swap(__that.__impl_);
13031303
}
13041304

1305-
# if _LIBCPP_STD_VER >= 26 && _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER
1305+
# if _LIBCPP_STD_VER >= 26
13061306
// Helper class to implement [variant.visit]/10
13071307
// Constraints: The call to visit does not use an explicit template-argument-list
13081308
// that begins with a type template-argument.
@@ -1319,7 +1319,7 @@ public:
13191319
_LIBCPP_HIDE_FROM_ABI constexpr _Rp visit(this _Self&& __self, _Visitor&& __visitor) {
13201320
return std::visit<_Rp>(std::forward<_Visitor>(__visitor), std::__forward_as<_Self, variant>(__self));
13211321
}
1322-
# endif
1322+
# endif // _LIBCPP_STD_VER >= 26
13231323

13241324
private:
13251325
__variant_detail::__impl<_Types...> __impl_;

libcxx/test/libcxx/fuzzing/random.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
// This test fails because Clang no longer enables -fdelayed-template-parsing
1010
// by default on Windows with C++20 (#69431).
11-
// XFAIL: msvc && (clang-18 || clang-19 || clang-20 || clang-21)
11+
// XFAIL: msvc && (clang-19 || clang-20 || clang-21)
1212

1313
// UNSUPPORTED: c++03, c++11
1414

libcxx/test/libcxx/gdb/gdb_pretty_printer_test.sh.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// UNSUPPORTED: c++03
1313

1414
// TODO: Investigate these failures which break the CI.
15-
// UNSUPPORTED: clang-18, clang-19, clang-20, clang-21
15+
// UNSUPPORTED: clang-19, clang-20, clang-21
1616

1717
// The Android libc++ tests are run on a non-Android host, connected to an
1818
// Android device over adb. gdb needs special support to make this work (e.g.

libcxx/test/libcxx/memory/shared_ptr_array.pass.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
// UNSUPPORTED: c++03, c++11, c++14, c++17
1111

1212
// These compiler versions and platforms don't enable sized deallocation by default.
13-
// ADDITIONAL_COMPILE_FLAGS(clang-17): -fsized-deallocation
14-
// ADDITIONAL_COMPILE_FLAGS(clang-18): -fsized-deallocation
1513
// ADDITIONAL_COMPILE_FLAGS(apple-clang-15): -fsized-deallocation
1614
// ADDITIONAL_COMPILE_FLAGS(apple-clang-16): -fsized-deallocation
1715
// ADDITIONAL_COMPILE_FLAGS(target=x86_64-w64-windows-gnu): -fsized-deallocation

libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/fetch_add.pass.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88
// UNSUPPORTED: c++03, c++11, c++14, c++17
99
// XFAIL: !has-64-bit-atomics
1010

11-
// Older versions of clang have a bug with atomic builtins affecting double and long double.
12-
// Fixed by 5fdd0948.
13-
// XFAIL: target=powerpc-ibm-{{.*}} && clang-18
14-
1511
// https://github.com/llvm/llvm-project/issues/72893
1612
// XFAIL: target={{x86_64-.*}} && tsan
1713

libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/fetch_sub.pass.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88
// UNSUPPORTED: c++03, c++11, c++14, c++17
99
// XFAIL: !has-64-bit-atomics
1010

11-
// Older versions of clang have a bug with atomic builtins affecting double and long double.
12-
// Fixed by 5fdd0948.
13-
// XFAIL: target=powerpc-ibm-{{.*}} && clang-18
14-
1511
// https://github.com/llvm/llvm-project/issues/72893
1612
// XFAIL: target={{x86_64-.*}} && tsan
1713

0 commit comments

Comments
 (0)