diff --git a/AK/NonnullOwnPtr.h b/AK/NonnullOwnPtr.h index 1553a9c562..58a3f3a7bf 100644 --- a/AK/NonnullOwnPtr.h +++ b/AK/NonnullOwnPtr.h @@ -33,7 +33,7 @@ public: : m_ptr(&ptr) { static_assert( - requires { requires typename T::AllowOwnPtr()(); } || !requires(T obj) { requires !typename T::AllowOwnPtr()(); obj.ref(); obj.unref(); }, + requires { requires typename T::AllowOwnPtr()(); } || !requires { requires !typename T::AllowOwnPtr()(); declval().ref(); declval().unref(); }, "Use NonnullRefPtr<> for RefCounted types"); } NonnullOwnPtr(NonnullOwnPtr&& other) diff --git a/AK/OwnPtr.h b/AK/OwnPtr.h index 3eb42d1c36..0fba019ddf 100644 --- a/AK/OwnPtr.h +++ b/AK/OwnPtr.h @@ -184,8 +184,7 @@ protected: : m_ptr(ptr) { static_assert( - requires { requires typename T::AllowOwnPtr()(); } || !requires(T obj) { requires !typename T::AllowOwnPtr()(); obj.ref(); obj.unref(); }, - "Use RefPtr<> for RefCounted types"); + requires { requires typename T::AllowOwnPtr()(); } || !requires { requires !typename T::AllowOwnPtr()(); declval().ref(); declval().unref(); }, "Use RefPtr<> for RefCounted types"); } private: