From c79e4961f6b30ba28d7db4cf189bc1ae1fb12c3d Mon Sep 17 00:00:00 2001 From: Hendiadyoin1 Date: Wed, 30 Mar 2022 21:37:26 +0200 Subject: LibJS: Add explicit default copy+move constructors to ThrowCompletionOr This stops clangd from complaining about not being able to determine the copy-constructibility of ThrowCompletionOr and Completion. --- Userland/Libraries/LibJS/Runtime/Completion.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Userland/Libraries/LibJS') diff --git a/Userland/Libraries/LibJS/Runtime/Completion.h b/Userland/Libraries/LibJS/Runtime/Completion.h index 5e857f1edb..52322e9b4c 100644 --- a/Userland/Libraries/LibJS/Runtime/Completion.h +++ b/Userland/Libraries/LibJS/Runtime/Completion.h @@ -49,6 +49,11 @@ public: { } + Completion(Completion const&) = default; + Completion& operator=(Completion const&) = default; + Completion(Completion&&) = default; + Completion& operator=(Completion&&) = default; + [[nodiscard]] Type type() const { return m_type; } [[nodiscard]] Optional& value() { return m_value; } [[nodiscard]] Optional const& value() const { return m_value; } @@ -112,6 +117,11 @@ public: VERIFY(!m_value->is_empty()); } + ThrowCompletionOr(ThrowCompletionOr const&) = default; + ThrowCompletionOr& operator=(ThrowCompletionOr const&) = default; + ThrowCompletionOr(ThrowCompletionOr&&) = default; + ThrowCompletionOr& operator=(ThrowCompletionOr&&) = default; + // Allows implicit construction of ThrowCompletionOr from a type U if T(U) is a supported constructor. // Most commonly: Value from Object* or similar, so we can omit the curly braces from "return { TRY(...) };". // Disabled for POD types to avoid weird conversion shenanigans. -- cgit v1.2.3