ladybird/Userland
Daniel Bertalan 9feb1ce39f LibJS+LibWeb: Apply the Rule of Zero to {Nonnull,}GCPtr<T>
The compiler-generated copy constructor and copy assignment operator
already do the right thing (which is to simply copy the underlying
pointer).

The [Itanium C++ ABI][1] treats any class with non-trivial copy/move
constructors and destructors as non-trivial for the purposes of calls --
even if they are functionally identical to the compiler-generated ones.
If a class is non-trivial, it cannot be passed or returned in registers,
only via an invisible reference, which is worse for codegen. This commit
makes `{Nonnull,}GCPtr` trivial.

As the compiler can be sure that capturing a `GCPtr` by value has no
side effects, a few `-Wunused-lambda-capture` warnings had to be
addressed in LibWeb.

GCC seems to have a bug that prevents `ExceptionOr<Variant<GCPtr<T>>>`
from being implicitly constructed from `GCPtr<T>` after this change. A
non-invasive workaround is to explicitly construct the inner Variant
type.

[1]: https://itanium-cxx-abi.github.io/cxx-abi/abi.html#non-trivial
2023-08-07 22:20:03 -04:00
..
Applets Everywhere: Remove needless trailing semi-colons after functions 2023-07-08 10:32:56 +01:00
Applications Calendar: Implement saving, loading, and displaying of calendars 2023-08-07 13:14:58 -06:00
BuggieBox Userland: Teach the file utility about zip files 2023-07-11 17:48:57 +01:00
Demos AK: Make "foo"_string infallible 2023-08-07 16:03:27 +02:00
DevTools AK: Make "foo"_string infallible 2023-08-07 16:03:27 +02:00
DynamicLoader Everywhere: Resolve conflicts with LibC and libc++ 2023-06-27 12:40:38 +02:00
Games AK: Make "foo"_string infallible 2023-08-07 16:03:27 +02:00
Libraries LibJS+LibWeb: Apply the Rule of Zero to {Nonnull,}GCPtr<T> 2023-08-07 22:20:03 -04:00
Services SQLServer: Remove Core::EventReceiver parent from DatabaseConnection 2023-08-07 14:38:38 -04:00
Shell AK: Make "foo"_string infallible 2023-08-07 16:03:27 +02:00
Utilities Ladybird: Move Qt-specific classes and functions to a Qt subdirectory 2023-08-07 14:58:04 -06:00
CMakeLists.txt Userland: Add the BuggieBox program 2022-11-26 12:41:47 -07:00