mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
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.
This commit is contained in:
parent
028bcd3d67
commit
d06809dee6
|
|
@ -521,7 +521,7 @@ template<typename T>
|
||||||
inline constexpr bool IsDestructible = requires { declval<T>().~T(); };
|
inline constexpr bool IsDestructible = requires { declval<T>().~T(); };
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
#if defined(AK_COMPILER_CLANG)
|
#if __has_builtin(__is_trivially_destructible)
|
||||||
inline constexpr bool IsTriviallyDestructible = __is_trivially_destructible(T);
|
inline constexpr bool IsTriviallyDestructible = __is_trivially_destructible(T);
|
||||||
#else
|
#else
|
||||||
inline constexpr bool IsTriviallyDestructible = __has_trivial_destructor(T) && IsDestructible<T>;
|
inline constexpr bool IsTriviallyDestructible = __has_trivial_destructor(T) && IsDestructible<T>;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user