Преглед на файлове

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 месеца
родител
ревизия
e636f3976d
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      AK/Optional.h

+ 1 - 1
AK/Optional.h

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