mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-30 05:05:10 +00:00
AK: Remove AK_HAS_CONDITIONALLY_TRIVIAL
Code behind this appears to compile nicely with Clang 17 and later.
This commit is contained in:
parent
ae11a4de1c
commit
6b2b90d2b0
|
@ -70,7 +70,6 @@ public:
|
|||
return *this;
|
||||
}
|
||||
|
||||
#ifdef AK_HAS_CONDITIONALLY_TRIVIAL
|
||||
Optional(Optional const& other)
|
||||
requires(!IsCopyConstructible<T>)
|
||||
= delete;
|
||||
|
@ -93,12 +92,9 @@ public:
|
|||
requires(!IsDestructible<T>)
|
||||
= delete;
|
||||
~Optional() = default;
|
||||
#endif
|
||||
|
||||
ALWAYS_INLINE Optional(Optional const& other)
|
||||
#ifdef AK_HAS_CONDITIONALLY_TRIVIAL
|
||||
requires(!IsTriviallyCopyConstructible<T>)
|
||||
#endif
|
||||
: m_has_value(other.m_has_value)
|
||||
{
|
||||
if (other.has_value())
|
||||
|
@ -138,9 +134,7 @@ public:
|
|||
}
|
||||
|
||||
ALWAYS_INLINE Optional& operator=(Optional const& other)
|
||||
#ifdef AK_HAS_CONDITIONALLY_TRIVIAL
|
||||
requires(!IsTriviallyCopyConstructible<T> || !IsTriviallyDestructible<T>)
|
||||
#endif
|
||||
{
|
||||
if (this != &other) {
|
||||
clear();
|
||||
|
@ -177,9 +171,7 @@ public:
|
|||
}
|
||||
|
||||
ALWAYS_INLINE ~Optional()
|
||||
#ifdef AK_HAS_CONDITIONALLY_TRIVIAL
|
||||
requires(!IsTriviallyDestructible<T>)
|
||||
#endif
|
||||
{
|
||||
clear();
|
||||
}
|
||||
|
|
|
@ -159,10 +159,6 @@
|
|||
# define VALIDATE_IS_RISCV64() static_assert(false, "Trying to include riscv64 only header on non riscv64 platform");
|
||||
#endif
|
||||
|
||||
#if !defined(AK_COMPILER_CLANG)
|
||||
# define AK_HAS_CONDITIONALLY_TRIVIAL
|
||||
#endif
|
||||
|
||||
// Apple Clang 14.0.3 (shipped in Xcode 14.3) has a bug that causes __builtin_subc{,l,ll}
|
||||
// to incorrectly return whether a borrow occurred on AArch64. See our writeup for the Qemu
|
||||
// issue also caused by it: https://gitlab.com/qemu-project/qemu/-/issues/1659#note_1408275831
|
||||
|
|
12
AK/Variant.h
12
AK/Variant.h
|
@ -267,7 +267,6 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
#ifdef AK_HAS_CONDITIONALLY_TRIVIAL
|
||||
Variant(Variant const&)
|
||||
requires(!(IsCopyConstructible<Ts> && ...))
|
||||
= delete;
|
||||
|
@ -292,12 +291,9 @@ public:
|
|||
requires(!(IsMoveConstructible<Ts> && ...) || !(IsDestructible<Ts> && ...))
|
||||
= delete;
|
||||
Variant& operator=(Variant&&) = default;
|
||||
#endif
|
||||
|
||||
ALWAYS_INLINE Variant(Variant const& old)
|
||||
#ifdef AK_HAS_CONDITIONALLY_TRIVIAL
|
||||
requires(!(IsTriviallyCopyConstructible<Ts> && ...))
|
||||
#endif
|
||||
: Detail::MergeAndDeduplicatePacks<Detail::VariantConstructors<Ts, Variant<Ts...>>...>()
|
||||
, m_data {}
|
||||
, m_index(old.m_index)
|
||||
|
@ -310,9 +306,7 @@ public:
|
|||
// and if a variant with a nontrivial move ctor is moved from, it may or may not be valid
|
||||
// but it will still contain the "moved-from" state of the object it previously contained.
|
||||
ALWAYS_INLINE Variant(Variant&& old)
|
||||
#ifdef AK_HAS_CONDITIONALLY_TRIVIAL
|
||||
requires(!(IsTriviallyMoveConstructible<Ts> && ...))
|
||||
#endif
|
||||
: Detail::MergeAndDeduplicatePacks<Detail::VariantConstructors<Ts, Variant<Ts...>>...>()
|
||||
, m_index(old.m_index)
|
||||
{
|
||||
|
@ -320,17 +314,13 @@ public:
|
|||
}
|
||||
|
||||
ALWAYS_INLINE ~Variant()
|
||||
#ifdef AK_HAS_CONDITIONALLY_TRIVIAL
|
||||
requires(!(IsTriviallyDestructible<Ts> && ...))
|
||||
#endif
|
||||
{
|
||||
Helper::delete_(m_index, m_data);
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Variant& operator=(Variant const& other)
|
||||
#ifdef AK_HAS_CONDITIONALLY_TRIVIAL
|
||||
requires(!(IsTriviallyCopyConstructible<Ts> && ...) || !(IsTriviallyDestructible<Ts> && ...))
|
||||
#endif
|
||||
{
|
||||
if (this != &other) {
|
||||
if constexpr (!(IsTriviallyDestructible<Ts> && ...)) {
|
||||
|
@ -343,9 +333,7 @@ public:
|
|||
}
|
||||
|
||||
ALWAYS_INLINE Variant& operator=(Variant&& other)
|
||||
#ifdef AK_HAS_CONDITIONALLY_TRIVIAL
|
||||
requires(!(IsTriviallyMoveConstructible<Ts> && ...) || !(IsTriviallyDestructible<Ts> && ...))
|
||||
#endif
|
||||
{
|
||||
if (this != &other) {
|
||||
if constexpr (!(IsTriviallyDestructible<Ts> && ...)) {
|
||||
|
|
Loading…
Reference in a new issue