mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-08 09:09:43 +00: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
Notes:
github-actions[bot]
2025-06-14 20:03:35 +00:00
Author: https://github.com/BertalanD
Commit: d06809dee6
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5083
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue