From b170e163b72825102fe05a81909e6864a6fe75e1 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Fri, 23 Jan 2026 07:32:23 -0500 Subject: [PATCH] AK+Kernel: Remove AK_COMPILER_APPLE_CLANG workarounds Xcode's clang is now new enough to no longer need these. --- AK/NonnullOwnPtr.h | 19 ------------------- AK/NonnullRefPtr.h | 18 ------------------ Kernel/Library/LockRefPtr.h | 9 --------- 3 files changed, 46 deletions(-) diff --git a/AK/NonnullOwnPtr.h b/AK/NonnullOwnPtr.h index e8ab1ab139e..6784fd61e89 100644 --- a/AK/NonnullOwnPtr.h +++ b/AK/NonnullOwnPtr.h @@ -150,15 +150,6 @@ requires(IsConstructible) inline NonnullOwnPtr make(Args&&... arg return NonnullOwnPtr(NonnullOwnPtr::Adopt, *new T(forward(args)...)); } -# ifdef AK_COMPILER_APPLE_CLANG -// FIXME: Remove once P0960R3 is available in Apple Clang. -template -inline NonnullOwnPtr make(Args&&... args) -{ - return NonnullOwnPtr(NonnullOwnPtr::Adopt, *new T { forward(args)... }); -} -# endif - #endif // Use like `adopt_nonnull_own_or_enomem(new (nothrow) T(args...))`. @@ -176,16 +167,6 @@ requires(IsConstructible) inline ErrorOr> try_make( return adopt_nonnull_own_or_enomem(new (nothrow) T(forward(args)...)); } -#ifdef AK_COMPILER_APPLE_CLANG -// FIXME: Remove once P0960R3 is available in Apple Clang. -template -inline ErrorOr> try_make(Args&&... args) - -{ - return adopt_nonnull_own_or_enomem(new (nothrow) T { forward(args)... }); -} -#endif - template struct Traits> : public DefaultTraits> { using PeekType = T*; diff --git a/AK/NonnullRefPtr.h b/AK/NonnullRefPtr.h index 24cdd781f04..68d551204a1 100644 --- a/AK/NonnullRefPtr.h +++ b/AK/NonnullRefPtr.h @@ -240,15 +240,6 @@ requires(IsConstructible) inline ErrorOr> try_make_ return adopt_nonnull_ref_or_enomem(new (nothrow) T(forward(args)...)); } -#ifdef AK_COMPILER_APPLE_CLANG -// FIXME: Remove once P0960R3 is available in Apple Clang. -template -inline ErrorOr> try_make_ref_counted(Args&&... args) -{ - return adopt_nonnull_ref_or_enomem(new (nothrow) T { forward(args)... }); -} -#endif - template struct Formatter> : Formatter { ErrorOr format(FormatBuilder& builder, NonnullRefPtr const& value) @@ -279,15 +270,6 @@ requires(IsConstructible) inline NonnullRefPtr make_ref_counted(A return NonnullRefPtr(NonnullRefPtr::Adopt, *new T(forward(args)...)); } -#ifdef AK_COMPILER_APPLE_CLANG -// FIXME: Remove once P0960R3 is available in Apple Clang. -template -inline NonnullRefPtr make_ref_counted(Args&&... args) -{ - return NonnullRefPtr(NonnullRefPtr::Adopt, *new T { forward(args)... }); -} -#endif - template struct Traits> : public DefaultTraits> { using PeekType = T*; diff --git a/Kernel/Library/LockRefPtr.h b/Kernel/Library/LockRefPtr.h index 3a66bd8e07e..1d6073b9ed7 100644 --- a/Kernel/Library/LockRefPtr.h +++ b/Kernel/Library/LockRefPtr.h @@ -500,15 +500,6 @@ requires(IsConstructible) inline ErrorOr> try_m return adopt_nonnull_lock_ref_or_enomem(new (nothrow) T(forward(args)...)); } -#ifdef AK_COMPILER_APPLE_CLANG -// FIXME: Remove once P0960R3 is available in Apple Clang. -template -inline ErrorOr> try_make_lock_ref_counted(Args&&... args) -{ - return adopt_nonnull_lock_ref_or_enomem(new (nothrow) T { forward(args)... }); -} -#endif - template inline ErrorOr> adopt_nonnull_lock_ref_or_enomem(T* object) {