From 20c6edc9766d3de72ffb790f29601ca3dfa660c7 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 21 Jul 2019 11:44:31 +0200 Subject: [PATCH] AK: Make NonnullRefPtr::operator=(NonnullRefPtr&&) cast incoming pointer. Same as the RefPtr issue I just fixed. This makes it possible to assign a NonnullRefPtr&& to a NonnullRefPtr. --- AK/NonnullRefPtr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AK/NonnullRefPtr.h b/AK/NonnullRefPtr.h index a055ccc681..9514a6da72 100644 --- a/AK/NonnullRefPtr.h +++ b/AK/NonnullRefPtr.h @@ -136,7 +136,7 @@ public: { if (this != static_cast(&other)) { deref_if_not_null(m_ptr); - m_ptr = &other.leak_ref(); + m_ptr = static_cast(&other.leak_ref()); } return *this; }