From d06809dee6b7fee5c521b3a37eef24b917a654b0 Mon Sep 17 00:00:00 2001 From: Daniel Bertalan Date: Fri, 13 Jun 2025 22:25:45 +0200 Subject: [PATCH] AK: Use `__is_trivially_destructible` built-in with new enough GCC GCC 16 trunk has started diagnosing calls to `__has_trivial_destructor` if the destructor is inaccessible. At the same time, they added a Clang-compatible `__is_trivially_destructible` built-in trait, so let's just use that. --- AK/StdLibExtraDetails.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AK/StdLibExtraDetails.h b/AK/StdLibExtraDetails.h index 34510870cce..67fcd50eeeb 100644 --- a/AK/StdLibExtraDetails.h +++ b/AK/StdLibExtraDetails.h @@ -521,7 +521,7 @@ template inline constexpr bool IsDestructible = requires { declval().~T(); }; template -#if defined(AK_COMPILER_CLANG) +#if __has_builtin(__is_trivially_destructible) inline constexpr bool IsTriviallyDestructible = __is_trivially_destructible(T); #else inline constexpr bool IsTriviallyDestructible = __has_trivial_destructor(T) && IsDestructible;