From d4b08b719652c5ad949ffd2b1007a5aeec7c3d06 Mon Sep 17 00:00:00 2001 From: Matthew Olsson Date: Sat, 25 Feb 2023 10:43:48 -0700 Subject: [PATCH] LibJS: Use a forwarding reference in ThrowCompletion constructor This avoids compiler complaints when trying to use const types --- Userland/Libraries/LibJS/Runtime/Completion.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibJS/Runtime/Completion.h b/Userland/Libraries/LibJS/Runtime/Completion.h index d7671c40ce..c4b07bd48c 100644 --- a/Userland/Libraries/LibJS/Runtime/Completion.h +++ b/Userland/Libraries/LibJS/Runtime/Completion.h @@ -307,7 +307,7 @@ public: // 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. template - ThrowCompletionOr(WrappedValueType const& value) + ThrowCompletionOr(WrappedValueType&& value) requires(!IsPOD) : m_value_or_throw_completion(ValueType { value }) {