Jelajahi Sumber

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.
Jonne Ransijn 9 bulan lalu
induk
melakukan
e636f3976d
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      AK/Optional.h

+ 1 - 1
AK/Optional.h

@@ -171,7 +171,7 @@ public:
     }
     }
 
 
     ALWAYS_INLINE ~Optional()
     ALWAYS_INLINE ~Optional()
-    requires(!IsTriviallyDestructible<T>)
+    requires(!IsTriviallyDestructible<T> && IsDestructible<T>)
     {
     {
         clear();
         clear();
     }
     }