From 639584fecb939a6d4456f7dc0a404f0cb255ac11 Mon Sep 17 00:00:00 2001 From: Veeti Paananen Date: Sun, 24 May 2026 22:20:07 +0300 Subject: [PATCH] AK: Skip Optional converting constructors when U is same as T MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This template is causing an "error: satisfaction of atomic constraint ‘IsConstructible [with T = X; X]’ depends on itself" through a self referential CSSScopeRule on GCC 16.1. Tighten the template requirements to avoid it. --- AK/Optional.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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())