diff --git a/AK/Optional.h b/AK/Optional.h index 1fc27230df..a768522540 100644 --- a/AK/Optional.h +++ b/AK/Optional.h @@ -209,7 +209,7 @@ public: } template - requires(IsConstructible && !IsSpecializationOf && !IsSpecializationOf && (!IsLvalueReference || IsTriviallyCopyConstructible)) ALWAYS_INLINE explicit constexpr Optional(Optional const& other) + requires(!IsSame && IsConstructible && !IsSpecializationOf && !IsSpecializationOf && (!IsLvalueReference || IsTriviallyCopyConstructible)) ALWAYS_INLINE explicit constexpr Optional(Optional const& other) : m_has_value(other.has_value()) { if (other.has_value()) @@ -219,7 +219,7 @@ public: } template - requires(IsConstructible && !IsSpecializationOf && !IsSpecializationOf && (!IsLvalueReference || IsTriviallyMoveConstructible)) ALWAYS_INLINE explicit constexpr Optional(Optional&& other) + requires(!IsSame && IsConstructible && !IsSpecializationOf && !IsSpecializationOf && (!IsLvalueReference || IsTriviallyMoveConstructible)) ALWAYS_INLINE explicit constexpr Optional(Optional&& other) : m_has_value(other.has_value()) { if (other.has_value())