AK: Skip Optional converting constructors when U is same as T
This template is causing an "error: satisfaction of atomic constraint ‘IsConstructible<T, const U&> [with T = X; X]’ depends on itself" through a self referential CSSScopeRule on GCC 16.1. Tighten the template requirements to avoid it.
This commit is contained in:
parent
5e42dd0e26
commit
639584fecb
1 changed files with 2 additions and 2 deletions
|
|
@ -209,7 +209,7 @@ public:
|
|||
}
|
||||
|
||||
template<typename U>
|
||||
requires(IsConstructible<T, U const&> && !IsSpecializationOf<T, Optional> && !IsSpecializationOf<U, Optional> && (!IsLvalueReference<U> || IsTriviallyCopyConstructible<U>)) ALWAYS_INLINE explicit constexpr Optional(Optional<U> const& other)
|
||||
requires(!IsSame<U, T> && IsConstructible<T, U const&> && !IsSpecializationOf<T, Optional> && !IsSpecializationOf<U, Optional> && (!IsLvalueReference<U> || IsTriviallyCopyConstructible<U>)) ALWAYS_INLINE explicit constexpr Optional(Optional<U> const& other)
|
||||
: m_has_value(other.has_value())
|
||||
{
|
||||
if (other.has_value())
|
||||
|
|
@ -219,7 +219,7 @@ public:
|
|||
}
|
||||
|
||||
template<typename U>
|
||||
requires(IsConstructible<T, U &&> && !IsSpecializationOf<T, Optional> && !IsSpecializationOf<U, Optional> && (!IsLvalueReference<U> || IsTriviallyMoveConstructible<U>)) ALWAYS_INLINE explicit constexpr Optional(Optional<U>&& other)
|
||||
requires(!IsSame<U, T> && IsConstructible<T, U &&> && !IsSpecializationOf<T, Optional> && !IsSpecializationOf<U, Optional> && (!IsLvalueReference<U> || IsTriviallyMoveConstructible<U>)) ALWAYS_INLINE explicit constexpr Optional(Optional<U>&& other)
|
||||
: m_has_value(other.has_value())
|
||||
{
|
||||
if (other.has_value())
|
||||
|
|
|
|||
Loading…
Reference in a new issue