From 34dba9e8e4d514dd3eb1ebea667c74a9f0cb6e7f Mon Sep 17 00:00:00 2001 From: Daniel Bertalan Date: Sun, 16 Jun 2024 10:38:35 +0200 Subject: [PATCH] Everywhere: Write dtors for types with incomplete members out-of-line These are rejected by Clang (19) trunk as a result of https://github.com/llvm/llvm-project/pull/77753. (cherry picked from commit bf1f631f257e90e91b0b45a6454d731b4b98914c) --- Userland/Libraries/LibCore/NetworkJob.cpp | 2 ++ Userland/Libraries/LibCore/NetworkJob.h | 2 +- Userland/Libraries/LibGfx/ImageFormats/JBIG2Loader.cpp | 2 ++ Userland/Libraries/LibGfx/ImageFormats/JBIG2Loader.h | 2 +- Userland/Libraries/LibGfx/ImageFormats/JPEG2000Loader.cpp | 2 ++ Userland/Libraries/LibGfx/ImageFormats/JPEG2000Loader.h | 2 +- Userland/Libraries/LibGfx/ImageFormats/TIFFLoader.cpp | 2 ++ Userland/Libraries/LibGfx/ImageFormats/TIFFLoader.h | 2 +- Userland/Libraries/LibGfx/ImageFormats/TinyVGLoader.cpp | 2 ++ Userland/Libraries/LibGfx/ImageFormats/TinyVGLoader.h | 2 +- Userland/Libraries/LibJS/CyclicModule.cpp | 2 ++ Userland/Libraries/LibJS/CyclicModule.h | 2 ++ Userland/Libraries/LibJS/Runtime/AsyncGenerator.cpp | 2 ++ Userland/Libraries/LibJS/Runtime/AsyncGenerator.h | 2 +- Userland/Libraries/LibJS/SourceTextModule.cpp | 2 ++ Userland/Libraries/LibJS/SourceTextModule.h | 2 ++ Userland/Libraries/LibProtocol/RequestClient.cpp | 2 ++ Userland/Libraries/LibProtocol/RequestClient.h | 1 + Userland/Libraries/LibWeb/CSS/FontFace.cpp | 2 ++ Userland/Libraries/LibWeb/CSS/FontFace.h | 2 +- Userland/Libraries/LibWeb/CSS/StyleValues/ImageStyleValue.cpp | 2 ++ Userland/Libraries/LibWeb/CSS/StyleValues/ImageStyleValue.h | 2 +- Userland/Services/WebContent/ConnectionFromClient.cpp | 2 ++ Userland/Services/WebContent/ConnectionFromClient.h | 2 +- Userland/Services/WebContent/PageClient.cpp | 2 ++ Userland/Services/WebContent/PageClient.h | 2 ++ 26 files changed, 42 insertions(+), 9 deletions(-) diff --git a/Userland/Libraries/LibCore/NetworkJob.cpp b/Userland/Libraries/LibCore/NetworkJob.cpp index 9ec5161759bafd..27619c58614f62 100644 --- a/Userland/Libraries/LibCore/NetworkJob.cpp +++ b/Userland/Libraries/LibCore/NetworkJob.cpp @@ -16,6 +16,8 @@ NetworkJob::NetworkJob(Core::File& output_stream) { } +NetworkJob::~NetworkJob() = default; + void NetworkJob::did_finish(NonnullRefPtr&& response) { if (is_cancelled()) diff --git a/Userland/Libraries/LibCore/NetworkJob.h b/Userland/Libraries/LibCore/NetworkJob.h index 8102ade0575bb4..cfdc7c541fa7a5 100644 --- a/Userland/Libraries/LibCore/NetworkJob.h +++ b/Userland/Libraries/LibCore/NetworkJob.h @@ -26,7 +26,7 @@ class NetworkJob : public EventReceiver { ProtocolFailed, Cancelled, }; - virtual ~NetworkJob() override = default; + virtual ~NetworkJob() override; // Could fire twice, after Headers and after Trailers! Function response_code)> on_headers_received; diff --git a/Userland/Libraries/LibGfx/ImageFormats/JBIG2Loader.cpp b/Userland/Libraries/LibGfx/ImageFormats/JBIG2Loader.cpp index 6e5db7cec73e31..8dcb4022ac7bad 100644 --- a/Userland/Libraries/LibGfx/ImageFormats/JBIG2Loader.cpp +++ b/Userland/Libraries/LibGfx/ImageFormats/JBIG2Loader.cpp @@ -2627,6 +2627,8 @@ JBIG2ImageDecoderPlugin::JBIG2ImageDecoderPlugin() m_context = make(); } +JBIG2ImageDecoderPlugin::~JBIG2ImageDecoderPlugin() = default; + IntSize JBIG2ImageDecoderPlugin::size() { return m_context->page.size; diff --git a/Userland/Libraries/LibGfx/ImageFormats/JBIG2Loader.h b/Userland/Libraries/LibGfx/ImageFormats/JBIG2Loader.h index 1841ed8be6dc48..7bcdfb79c11d81 100644 --- a/Userland/Libraries/LibGfx/ImageFormats/JBIG2Loader.h +++ b/Userland/Libraries/LibGfx/ImageFormats/JBIG2Loader.h @@ -19,7 +19,7 @@ class JBIG2ImageDecoderPlugin : public ImageDecoderPlugin { static bool sniff(ReadonlyBytes); static ErrorOr> create(ReadonlyBytes); - virtual ~JBIG2ImageDecoderPlugin() override = default; + virtual ~JBIG2ImageDecoderPlugin() override; virtual IntSize size() override; diff --git a/Userland/Libraries/LibGfx/ImageFormats/JPEG2000Loader.cpp b/Userland/Libraries/LibGfx/ImageFormats/JPEG2000Loader.cpp index 62b3994ba5bd11..28fdcf2a68a4e2 100644 --- a/Userland/Libraries/LibGfx/ImageFormats/JPEG2000Loader.cpp +++ b/Userland/Libraries/LibGfx/ImageFormats/JPEG2000Loader.cpp @@ -988,6 +988,8 @@ JPEG2000ImageDecoderPlugin::JPEG2000ImageDecoderPlugin() m_context = make(); } +JPEG2000ImageDecoderPlugin::~JPEG2000ImageDecoderPlugin() = default; + IntSize JPEG2000ImageDecoderPlugin::size() { return m_context->size; diff --git a/Userland/Libraries/LibGfx/ImageFormats/JPEG2000Loader.h b/Userland/Libraries/LibGfx/ImageFormats/JPEG2000Loader.h index a1f8136fa9268f..0d8c6450b5e68a 100644 --- a/Userland/Libraries/LibGfx/ImageFormats/JPEG2000Loader.h +++ b/Userland/Libraries/LibGfx/ImageFormats/JPEG2000Loader.h @@ -37,7 +37,7 @@ class JPEG2000ImageDecoderPlugin : public ImageDecoderPlugin { static bool sniff(ReadonlyBytes); static ErrorOr> create(ReadonlyBytes); - virtual ~JPEG2000ImageDecoderPlugin() override = default; + virtual ~JPEG2000ImageDecoderPlugin() override; virtual IntSize size() override; diff --git a/Userland/Libraries/LibGfx/ImageFormats/TIFFLoader.cpp b/Userland/Libraries/LibGfx/ImageFormats/TIFFLoader.cpp index 3b8f6e0b965034..693502877ef67c 100644 --- a/Userland/Libraries/LibGfx/ImageFormats/TIFFLoader.cpp +++ b/Userland/Libraries/LibGfx/ImageFormats/TIFFLoader.cpp @@ -748,6 +748,8 @@ TIFFImageDecoderPlugin::TIFFImageDecoderPlugin(NonnullOwnPtr m_context = make(move(stream)); } +TIFFImageDecoderPlugin::~TIFFImageDecoderPlugin() = default; + bool TIFFImageDecoderPlugin::sniff(ReadonlyBytes bytes) { if (bytes.size() < 4) diff --git a/Userland/Libraries/LibGfx/ImageFormats/TIFFLoader.h b/Userland/Libraries/LibGfx/ImageFormats/TIFFLoader.h index 02847a2e2ba404..177306e416468a 100644 --- a/Userland/Libraries/LibGfx/ImageFormats/TIFFLoader.h +++ b/Userland/Libraries/LibGfx/ImageFormats/TIFFLoader.h @@ -38,7 +38,7 @@ class TIFFImageDecoderPlugin : public ImageDecoderPlugin { static ErrorOr> create(ReadonlyBytes); static ErrorOr> read_exif_metadata(ReadonlyBytes); - virtual ~TIFFImageDecoderPlugin() override = default; + virtual ~TIFFImageDecoderPlugin() override; virtual IntSize size() override; diff --git a/Userland/Libraries/LibGfx/ImageFormats/TinyVGLoader.cpp b/Userland/Libraries/LibGfx/ImageFormats/TinyVGLoader.cpp index 8085ed815bf195..1705d064a3c914 100644 --- a/Userland/Libraries/LibGfx/ImageFormats/TinyVGLoader.cpp +++ b/Userland/Libraries/LibGfx/ImageFormats/TinyVGLoader.cpp @@ -550,6 +550,8 @@ TinyVGImageDecoderPlugin::TinyVGImageDecoderPlugin(ReadonlyBytes bytes) { } +TinyVGImageDecoderPlugin::~TinyVGImageDecoderPlugin() = default; + ErrorOr> TinyVGImageDecoderPlugin::create(ReadonlyBytes bytes) { auto plugin = TRY(adopt_nonnull_own_or_enomem(new (nothrow) TinyVGImageDecoderPlugin(bytes))); diff --git a/Userland/Libraries/LibGfx/ImageFormats/TinyVGLoader.h b/Userland/Libraries/LibGfx/ImageFormats/TinyVGLoader.h index 5ea7a4aa521a45..8ca323741a9c34 100644 --- a/Userland/Libraries/LibGfx/ImageFormats/TinyVGLoader.h +++ b/Userland/Libraries/LibGfx/ImageFormats/TinyVGLoader.h @@ -86,7 +86,7 @@ class TinyVGImageDecoderPlugin final : public ImageDecoderPlugin { virtual NaturalFrameFormat natural_frame_format() const override { return NaturalFrameFormat::Vector; } virtual ErrorOr vector_frame(size_t index) override; - virtual ~TinyVGImageDecoderPlugin() override = default; + virtual ~TinyVGImageDecoderPlugin() override; private: TinyVGImageDecoderPlugin(ReadonlyBytes); diff --git a/Userland/Libraries/LibJS/CyclicModule.cpp b/Userland/Libraries/LibJS/CyclicModule.cpp index 8bf8aa39fd2206..9fd15a9049c30d 100644 --- a/Userland/Libraries/LibJS/CyclicModule.cpp +++ b/Userland/Libraries/LibJS/CyclicModule.cpp @@ -24,6 +24,8 @@ CyclicModule::CyclicModule(Realm& realm, StringView filename, bool has_top_level { } +CyclicModule::~CyclicModule() = default; + void CyclicModule::visit_edges(Cell::Visitor& visitor) { Base::visit_edges(visitor); diff --git a/Userland/Libraries/LibJS/CyclicModule.h b/Userland/Libraries/LibJS/CyclicModule.h index b569ef59fe6cb7..3a2ced3d68f42a 100644 --- a/Userland/Libraries/LibJS/CyclicModule.h +++ b/Userland/Libraries/LibJS/CyclicModule.h @@ -29,6 +29,8 @@ class CyclicModule : public Module { JS_DECLARE_ALLOCATOR(CyclicModule); public: + virtual ~CyclicModule() override; + // Note: Do not call these methods directly unless you are HostResolveImportedModule. // Badges cannot be used because other hosts must be able to call this (and it is called recursively) virtual ThrowCompletionOr link(VM& vm) override final; diff --git a/Userland/Libraries/LibJS/Runtime/AsyncGenerator.cpp b/Userland/Libraries/LibJS/Runtime/AsyncGenerator.cpp index 94fdd774819c95..74e8e985f838ba 100644 --- a/Userland/Libraries/LibJS/Runtime/AsyncGenerator.cpp +++ b/Userland/Libraries/LibJS/Runtime/AsyncGenerator.cpp @@ -34,6 +34,8 @@ AsyncGenerator::AsyncGenerator(Realm&, Object& prototype, NonnullOwnPtr> create(Realm&, Value, ECMAScriptFunctionObject*, NonnullOwnPtr); - virtual ~AsyncGenerator() override = default; + virtual ~AsyncGenerator() override; void async_generator_enqueue(Completion, NonnullGCPtr); ThrowCompletionOr resume(VM&, Completion completion); diff --git a/Userland/Libraries/LibJS/SourceTextModule.cpp b/Userland/Libraries/LibJS/SourceTextModule.cpp index eaf04a23e16d08..b50c671ca21f76 100644 --- a/Userland/Libraries/LibJS/SourceTextModule.cpp +++ b/Userland/Libraries/LibJS/SourceTextModule.cpp @@ -116,6 +116,8 @@ SourceTextModule::SourceTextModule(Realm& realm, StringView filename, Script::Ho { } +SourceTextModule::~SourceTextModule() = default; + void SourceTextModule::visit_edges(Cell::Visitor& visitor) { Base::visit_edges(visitor); diff --git a/Userland/Libraries/LibJS/SourceTextModule.h b/Userland/Libraries/LibJS/SourceTextModule.h index 2069495d23de47..5ab4717eea16a6 100644 --- a/Userland/Libraries/LibJS/SourceTextModule.h +++ b/Userland/Libraries/LibJS/SourceTextModule.h @@ -19,6 +19,8 @@ class SourceTextModule final : public CyclicModule { JS_DECLARE_ALLOCATOR(SourceTextModule); public: + virtual ~SourceTextModule() override; + static Result, Vector> parse(StringView source_text, Realm&, StringView filename = {}, Script::HostDefined* host_defined = nullptr); Program const& parse_node() const { return *m_ecmascript_code; } diff --git a/Userland/Libraries/LibProtocol/RequestClient.cpp b/Userland/Libraries/LibProtocol/RequestClient.cpp index 835226b98f830d..2fa3e35c927719 100644 --- a/Userland/Libraries/LibProtocol/RequestClient.cpp +++ b/Userland/Libraries/LibProtocol/RequestClient.cpp @@ -14,6 +14,8 @@ RequestClient::RequestClient(NonnullOwnPtr socket) { } +RequestClient::~RequestClient() = default; + void RequestClient::die() { // FIXME: Gracefully handle this, or relaunch and reconnect to RequestServer. diff --git a/Userland/Libraries/LibProtocol/RequestClient.h b/Userland/Libraries/LibProtocol/RequestClient.h index fbb1c79a3bba12..b4e282692a8418 100644 --- a/Userland/Libraries/LibProtocol/RequestClient.h +++ b/Userland/Libraries/LibProtocol/RequestClient.h @@ -25,6 +25,7 @@ class RequestClient final public: explicit RequestClient(NonnullOwnPtr); + virtual ~RequestClient() override; RefPtr start_request(ByteString const& method, URL::URL const&, HTTP::HeaderMap const& request_headers = {}, ReadonlyBytes request_body = {}, Core::ProxyData const& = {}); diff --git a/Userland/Libraries/LibWeb/CSS/FontFace.cpp b/Userland/Libraries/LibWeb/CSS/FontFace.cpp index a21307420ea77e..c9ace000050127 100644 --- a/Userland/Libraries/LibWeb/CSS/FontFace.cpp +++ b/Userland/Libraries/LibWeb/CSS/FontFace.cpp @@ -198,6 +198,8 @@ FontFace::FontFace(JS::Realm& realm, JS::NonnullGCPtr font_stat m_status = Bindings::FontFaceLoadStatus::Error; } +FontFace::~FontFace() = default; + void FontFace::initialize(JS::Realm& realm) { Base::initialize(realm); diff --git a/Userland/Libraries/LibWeb/CSS/FontFace.h b/Userland/Libraries/LibWeb/CSS/FontFace.h index c5cb69a9272fa9..1bf5661374ebae 100644 --- a/Userland/Libraries/LibWeb/CSS/FontFace.h +++ b/Userland/Libraries/LibWeb/CSS/FontFace.h @@ -35,7 +35,7 @@ class FontFace final : public Bindings::PlatformObject { using FontFaceSource = Variant>; [[nodiscard]] static JS::NonnullGCPtr construct_impl(JS::Realm&, String family, FontFaceSource source, FontFaceDescriptors const& descriptors); - virtual ~FontFace() override = default; + virtual ~FontFace() override; String family() const { return m_family; } WebIDL::ExceptionOr set_family(String const&); diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/ImageStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/ImageStyleValue.cpp index 991f04096c7460..9c7d9c6e36843f 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/ImageStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/ImageStyleValue.cpp @@ -26,6 +26,8 @@ ImageStyleValue::ImageStyleValue(URL::URL const& url) { } +ImageStyleValue::~ImageStyleValue() = default; + void ImageStyleValue::load_any_resources(DOM::Document& document) { if (m_image_request) diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/ImageStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/ImageStyleValue.h index a67467cdf43523..79c9656b444b71 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/ImageStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/ImageStyleValue.h @@ -26,7 +26,7 @@ class ImageStyleValue final { return adopt_ref(*new (nothrow) ImageStyleValue(url)); } - virtual ~ImageStyleValue() override = default; + virtual ~ImageStyleValue() override; void visit_edges(JS::Cell::Visitor& visitor) const { diff --git a/Userland/Services/WebContent/ConnectionFromClient.cpp b/Userland/Services/WebContent/ConnectionFromClient.cpp index 84b68499b9f07c..6a9160e7ba9277 100644 --- a/Userland/Services/WebContent/ConnectionFromClient.cpp +++ b/Userland/Services/WebContent/ConnectionFromClient.cpp @@ -62,6 +62,8 @@ ConnectionFromClient::ConnectionFromClient(NonnullOwnPtr sock async_notify_process_information({ ::getpid() }); } +ConnectionFromClient::~ConnectionFromClient() = default; + void ConnectionFromClient::die() { Web::Platform::EventLoopPlugin::the().quit(); diff --git a/Userland/Services/WebContent/ConnectionFromClient.h b/Userland/Services/WebContent/ConnectionFromClient.h index 60175ee5a41311..c5e736d1c6c043 100644 --- a/Userland/Services/WebContent/ConnectionFromClient.h +++ b/Userland/Services/WebContent/ConnectionFromClient.h @@ -32,7 +32,7 @@ class ConnectionFromClient final C_OBJECT(ConnectionFromClient); public: - ~ConnectionFromClient() override = default; + ~ConnectionFromClient() override; virtual void die() override; diff --git a/Userland/Services/WebContent/PageClient.cpp b/Userland/Services/WebContent/PageClient.cpp index 741f23a3a20596..9912796b1bc2f0 100644 --- a/Userland/Services/WebContent/PageClient.cpp +++ b/Userland/Services/WebContent/PageClient.cpp @@ -75,6 +75,8 @@ PageClient::PageClient(PageHost& owner, u64 id) #endif } +PageClient::~PageClient() = default; + void PageClient::schedule_repaint() { if (m_paint_state != PaintState::Ready) { diff --git a/Userland/Services/WebContent/PageClient.h b/Userland/Services/WebContent/PageClient.h index eb982b8bb52f12..87a0a2d0026fb5 100644 --- a/Userland/Services/WebContent/PageClient.h +++ b/Userland/Services/WebContent/PageClient.h @@ -29,6 +29,8 @@ class PageClient final : public Web::PageClient { public: static JS::NonnullGCPtr create(JS::VM& vm, PageHost& page_host, u64 id); + virtual ~PageClient() override; + static void set_use_gpu_painter(); static void set_use_experimental_cpu_transform_support();