mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 19:29:16 +00:00
AK: Don't implicitly convert Optional<T&> to Optional<T>
C++ will jovially select the implicit conversion operator, even if it's complete bogus, such as for unknown-size types or non-destructible types. Therefore, all such conversions (which incur a copy) must (unfortunately) be explicit so that non-copyable types continue to work. NOTE: We make an exception for trivially copyable types, since they are, well, trivially copyable. Co-authored-by: kleines Filmröllchen <filmroellchen@serenityos.org>
This commit is contained in:
committed by
Ali Mohammad Pur
parent
8468fb9ae5
commit
d7596a0a61
@@ -467,7 +467,7 @@ WebIDL::ExceptionOr<GC::Ref<Request>> Request::construct_impl(JS::Realm& realm,
|
||||
}
|
||||
|
||||
// 38. Let inputOrInitBody be initBody if it is non-null; otherwise inputBody.
|
||||
Optional<Infrastructure::Request::BodyType> input_or_init_body = init_body
|
||||
Optional<Infrastructure::Request::BodyType const&> input_or_init_body = init_body
|
||||
? Infrastructure::Request::BodyType { *init_body }
|
||||
: input_body;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user