From e636f3976d48a9c6f751c8471a44c309f1063df8 Mon Sep 17 00:00:00 2001 From: Jonne Ransijn Date: Tue, 22 Oct 2024 16:47:01 +0200 Subject: [PATCH] AK: Fix ambiguity in `AK::Optional` specialization The specialization for the destructor of `AK::Optional` is ambiguous when `T` is neither TriviallyDestructible nor Destructible. The fix adds an additional check for `Destructible` when generating the destructor of `AK::Optional`, since it calls the destructor of `T`, and therefore already required `T` to be `Destructible` anyway. --- AK/Optional.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AK/Optional.h b/AK/Optional.h index 658496fa319..6ebee5ecfa8 100644 --- a/AK/Optional.h +++ b/AK/Optional.h @@ -171,7 +171,7 @@ public: } ALWAYS_INLINE ~Optional() - requires(!IsTriviallyDestructible) + requires(!IsTriviallyDestructible && IsDestructible) { clear(); }