Skip to content

Commit

Permalink
Everywhere: Write dtors for types with incomplete members out-of-line
Browse files Browse the repository at this point in the history
These are rejected by Clang (19) trunk as a result of
llvm/llvm-project#77753.

(cherry picked from commit bf1f631f257e90e91b0b45a6454d731b4b98914c)
  • Loading branch information
BertalanD authored and nico committed Jun 25, 2024
1 parent d1f1a6e commit 8d2a8db
Show file tree
Hide file tree
Showing 26 changed files with 42 additions and 9 deletions.
2 changes: 2 additions & 0 deletions Userland/Libraries/LibCore/NetworkJob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ NetworkJob::NetworkJob(Core::File& output_stream)
{
}

NetworkJob::~NetworkJob() = default;

void NetworkJob::did_finish(NonnullRefPtr<NetworkResponse>&& response)
{
if (is_cancelled())
Expand Down
2 changes: 1 addition & 1 deletion Userland/Libraries/LibCore/NetworkJob.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<void(HTTP::HeaderMap const& response_headers, Optional<u32> response_code)> on_headers_received;
Expand Down
2 changes: 2 additions & 0 deletions Userland/Libraries/LibGfx/ImageFormats/JBIG2Loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2627,6 +2627,8 @@ JBIG2ImageDecoderPlugin::JBIG2ImageDecoderPlugin()
m_context = make<JBIG2LoadingContext>();
}

JBIG2ImageDecoderPlugin::~JBIG2ImageDecoderPlugin() = default;

IntSize JBIG2ImageDecoderPlugin::size()
{
return m_context->page.size;
Expand Down
2 changes: 1 addition & 1 deletion Userland/Libraries/LibGfx/ImageFormats/JBIG2Loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class JBIG2ImageDecoderPlugin : public ImageDecoderPlugin {
static bool sniff(ReadonlyBytes);
static ErrorOr<NonnullOwnPtr<ImageDecoderPlugin>> create(ReadonlyBytes);

virtual ~JBIG2ImageDecoderPlugin() override = default;
virtual ~JBIG2ImageDecoderPlugin() override;

virtual IntSize size() override;

Expand Down
2 changes: 2 additions & 0 deletions Userland/Libraries/LibGfx/ImageFormats/JPEG2000Loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -988,6 +988,8 @@ JPEG2000ImageDecoderPlugin::JPEG2000ImageDecoderPlugin()
m_context = make<JPEG2000LoadingContext>();
}

JPEG2000ImageDecoderPlugin::~JPEG2000ImageDecoderPlugin() = default;

IntSize JPEG2000ImageDecoderPlugin::size()
{
return m_context->size;
Expand Down
2 changes: 1 addition & 1 deletion Userland/Libraries/LibGfx/ImageFormats/JPEG2000Loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class JPEG2000ImageDecoderPlugin : public ImageDecoderPlugin {
static bool sniff(ReadonlyBytes);
static ErrorOr<NonnullOwnPtr<ImageDecoderPlugin>> create(ReadonlyBytes);

virtual ~JPEG2000ImageDecoderPlugin() override = default;
virtual ~JPEG2000ImageDecoderPlugin() override;

virtual IntSize size() override;

Expand Down
2 changes: 2 additions & 0 deletions Userland/Libraries/LibGfx/ImageFormats/TIFFLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,8 @@ TIFFImageDecoderPlugin::TIFFImageDecoderPlugin(NonnullOwnPtr<FixedMemoryStream>
m_context = make<TIFF::TIFFLoadingContext>(move(stream));
}

TIFFImageDecoderPlugin::~TIFFImageDecoderPlugin() = default;

bool TIFFImageDecoderPlugin::sniff(ReadonlyBytes bytes)
{
if (bytes.size() < 4)
Expand Down
2 changes: 1 addition & 1 deletion Userland/Libraries/LibGfx/ImageFormats/TIFFLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class TIFFImageDecoderPlugin : public ImageDecoderPlugin {
static ErrorOr<NonnullOwnPtr<ImageDecoderPlugin>> create(ReadonlyBytes);
static ErrorOr<NonnullOwnPtr<ExifMetadata>> read_exif_metadata(ReadonlyBytes);

virtual ~TIFFImageDecoderPlugin() override = default;
virtual ~TIFFImageDecoderPlugin() override;

virtual IntSize size() override;

Expand Down
2 changes: 2 additions & 0 deletions Userland/Libraries/LibGfx/ImageFormats/TinyVGLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,8 @@ TinyVGImageDecoderPlugin::TinyVGImageDecoderPlugin(ReadonlyBytes bytes)
{
}

TinyVGImageDecoderPlugin::~TinyVGImageDecoderPlugin() = default;

ErrorOr<NonnullOwnPtr<ImageDecoderPlugin>> TinyVGImageDecoderPlugin::create(ReadonlyBytes bytes)
{
auto plugin = TRY(adopt_nonnull_own_or_enomem(new (nothrow) TinyVGImageDecoderPlugin(bytes)));
Expand Down
2 changes: 1 addition & 1 deletion Userland/Libraries/LibGfx/ImageFormats/TinyVGLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class TinyVGImageDecoderPlugin final : public ImageDecoderPlugin {
virtual NaturalFrameFormat natural_frame_format() const override { return NaturalFrameFormat::Vector; }
virtual ErrorOr<VectorImageFrameDescriptor> vector_frame(size_t index) override;

virtual ~TinyVGImageDecoderPlugin() override = default;
virtual ~TinyVGImageDecoderPlugin() override;

private:
TinyVGImageDecoderPlugin(ReadonlyBytes);
Expand Down
2 changes: 2 additions & 0 deletions Userland/Libraries/LibJS/CyclicModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions Userland/Libraries/LibJS/CyclicModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<void> link(VM& vm) override final;
Expand Down
2 changes: 2 additions & 0 deletions Userland/Libraries/LibJS/Runtime/AsyncGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ AsyncGenerator::AsyncGenerator(Realm&, Object& prototype, NonnullOwnPtr<Executio
{
}

AsyncGenerator::~AsyncGenerator() = default;

void AsyncGenerator::visit_edges(Cell::Visitor& visitor)
{
Base::visit_edges(visitor);
Expand Down
2 changes: 1 addition & 1 deletion Userland/Libraries/LibJS/Runtime/AsyncGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class AsyncGenerator final : public Object {

static ThrowCompletionOr<NonnullGCPtr<AsyncGenerator>> create(Realm&, Value, ECMAScriptFunctionObject*, NonnullOwnPtr<ExecutionContext>);

virtual ~AsyncGenerator() override = default;
virtual ~AsyncGenerator() override;

void async_generator_enqueue(Completion, NonnullGCPtr<PromiseCapability>);
ThrowCompletionOr<void> resume(VM&, Completion completion);
Expand Down
2 changes: 2 additions & 0 deletions Userland/Libraries/LibJS/SourceTextModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions Userland/Libraries/LibJS/SourceTextModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class SourceTextModule final : public CyclicModule {
JS_DECLARE_ALLOCATOR(SourceTextModule);

public:
virtual ~SourceTextModule() override;

static Result<NonnullGCPtr<SourceTextModule>, Vector<ParserError>> parse(StringView source_text, Realm&, StringView filename = {}, Script::HostDefined* host_defined = nullptr);

Program const& parse_node() const { return *m_ecmascript_code; }
Expand Down
2 changes: 2 additions & 0 deletions Userland/Libraries/LibProtocol/RequestClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ RequestClient::RequestClient(NonnullOwnPtr<Core::LocalSocket> socket)
{
}

RequestClient::~RequestClient() = default;

void RequestClient::die()
{
// FIXME: Gracefully handle this, or relaunch and reconnect to RequestServer.
Expand Down
1 change: 1 addition & 0 deletions Userland/Libraries/LibProtocol/RequestClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class RequestClient final

public:
explicit RequestClient(NonnullOwnPtr<Core::LocalSocket>);
virtual ~RequestClient() override;

RefPtr<Request> start_request(ByteString const& method, URL::URL const&, HTTP::HeaderMap const& request_headers = {}, ReadonlyBytes request_body = {}, Core::ProxyData const& = {});

Expand Down
2 changes: 2 additions & 0 deletions Userland/Libraries/LibWeb/CSS/FontFace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ FontFace::FontFace(JS::Realm& realm, JS::NonnullGCPtr<WebIDL::Promise> font_stat
m_status = Bindings::FontFaceLoadStatus::Error;
}

FontFace::~FontFace() = default;

void FontFace::initialize(JS::Realm& realm)
{
Base::initialize(realm);
Expand Down
2 changes: 1 addition & 1 deletion Userland/Libraries/LibWeb/CSS/FontFace.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class FontFace final : public Bindings::PlatformObject {
using FontFaceSource = Variant<String, JS::Handle<WebIDL::BufferSource>>;

[[nodiscard]] static JS::NonnullGCPtr<FontFace> 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<void> set_family(String const&);
Expand Down
2 changes: 2 additions & 0 deletions Userland/Libraries/LibWeb/CSS/StyleValues/ImageStyleValue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 2 additions & 0 deletions Userland/Services/WebContent/ConnectionFromClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ ConnectionFromClient::ConnectionFromClient(NonnullOwnPtr<Core::LocalSocket> sock
async_notify_process_information({ ::getpid() });
}

ConnectionFromClient::~ConnectionFromClient() = default;

void ConnectionFromClient::die()
{
Web::Platform::EventLoopPlugin::the().quit();
Expand Down
2 changes: 1 addition & 1 deletion Userland/Services/WebContent/ConnectionFromClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class ConnectionFromClient final
C_OBJECT(ConnectionFromClient);

public:
~ConnectionFromClient() override = default;
~ConnectionFromClient() override;

virtual void die() override;

Expand Down
2 changes: 2 additions & 0 deletions Userland/Services/WebContent/PageClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ PageClient::PageClient(PageHost& owner, u64 id)
#endif
}

PageClient::~PageClient() = default;

void PageClient::schedule_repaint()
{
if (m_paint_state != PaintState::Ready) {
Expand Down
2 changes: 2 additions & 0 deletions Userland/Services/WebContent/PageClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ class PageClient final : public Web::PageClient {
public:
static JS::NonnullGCPtr<PageClient> 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();

Expand Down

0 comments on commit 8d2a8db

Please sign in to comment.