Skip to content

Commit 8d2a8db

Browse files
BertalanDnico
authored andcommitted
Everywhere: Write dtors for types with incomplete members out-of-line
These are rejected by Clang (19) trunk as a result of llvm/llvm-project#77753. (cherry picked from commit bf1f631)
1 parent d1f1a6e commit 8d2a8db

26 files changed

+42
-9
lines changed

Userland/Libraries/LibCore/NetworkJob.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ NetworkJob::NetworkJob(Core::File& output_stream)
1616
{
1717
}
1818

19+
NetworkJob::~NetworkJob() = default;
20+
1921
void NetworkJob::did_finish(NonnullRefPtr<NetworkResponse>&& response)
2022
{
2123
if (is_cancelled())

Userland/Libraries/LibCore/NetworkJob.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class NetworkJob : public EventReceiver {
2626
ProtocolFailed,
2727
Cancelled,
2828
};
29-
virtual ~NetworkJob() override = default;
29+
virtual ~NetworkJob() override;
3030

3131
// Could fire twice, after Headers and after Trailers!
3232
Function<void(HTTP::HeaderMap const& response_headers, Optional<u32> response_code)> on_headers_received;

Userland/Libraries/LibGfx/ImageFormats/JBIG2Loader.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2627,6 +2627,8 @@ JBIG2ImageDecoderPlugin::JBIG2ImageDecoderPlugin()
26272627
m_context = make<JBIG2LoadingContext>();
26282628
}
26292629

2630+
JBIG2ImageDecoderPlugin::~JBIG2ImageDecoderPlugin() = default;
2631+
26302632
IntSize JBIG2ImageDecoderPlugin::size()
26312633
{
26322634
return m_context->page.size;

Userland/Libraries/LibGfx/ImageFormats/JBIG2Loader.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class JBIG2ImageDecoderPlugin : public ImageDecoderPlugin {
1919
static bool sniff(ReadonlyBytes);
2020
static ErrorOr<NonnullOwnPtr<ImageDecoderPlugin>> create(ReadonlyBytes);
2121

22-
virtual ~JBIG2ImageDecoderPlugin() override = default;
22+
virtual ~JBIG2ImageDecoderPlugin() override;
2323

2424
virtual IntSize size() override;
2525

Userland/Libraries/LibGfx/ImageFormats/JPEG2000Loader.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -988,6 +988,8 @@ JPEG2000ImageDecoderPlugin::JPEG2000ImageDecoderPlugin()
988988
m_context = make<JPEG2000LoadingContext>();
989989
}
990990

991+
JPEG2000ImageDecoderPlugin::~JPEG2000ImageDecoderPlugin() = default;
992+
991993
IntSize JPEG2000ImageDecoderPlugin::size()
992994
{
993995
return m_context->size;

Userland/Libraries/LibGfx/ImageFormats/JPEG2000Loader.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class JPEG2000ImageDecoderPlugin : public ImageDecoderPlugin {
3737
static bool sniff(ReadonlyBytes);
3838
static ErrorOr<NonnullOwnPtr<ImageDecoderPlugin>> create(ReadonlyBytes);
3939

40-
virtual ~JPEG2000ImageDecoderPlugin() override = default;
40+
virtual ~JPEG2000ImageDecoderPlugin() override;
4141

4242
virtual IntSize size() override;
4343

Userland/Libraries/LibGfx/ImageFormats/TIFFLoader.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,8 @@ TIFFImageDecoderPlugin::TIFFImageDecoderPlugin(NonnullOwnPtr<FixedMemoryStream>
748748
m_context = make<TIFF::TIFFLoadingContext>(move(stream));
749749
}
750750

751+
TIFFImageDecoderPlugin::~TIFFImageDecoderPlugin() = default;
752+
751753
bool TIFFImageDecoderPlugin::sniff(ReadonlyBytes bytes)
752754
{
753755
if (bytes.size() < 4)

Userland/Libraries/LibGfx/ImageFormats/TIFFLoader.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class TIFFImageDecoderPlugin : public ImageDecoderPlugin {
3838
static ErrorOr<NonnullOwnPtr<ImageDecoderPlugin>> create(ReadonlyBytes);
3939
static ErrorOr<NonnullOwnPtr<ExifMetadata>> read_exif_metadata(ReadonlyBytes);
4040

41-
virtual ~TIFFImageDecoderPlugin() override = default;
41+
virtual ~TIFFImageDecoderPlugin() override;
4242

4343
virtual IntSize size() override;
4444

Userland/Libraries/LibGfx/ImageFormats/TinyVGLoader.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,8 @@ TinyVGImageDecoderPlugin::TinyVGImageDecoderPlugin(ReadonlyBytes bytes)
550550
{
551551
}
552552

553+
TinyVGImageDecoderPlugin::~TinyVGImageDecoderPlugin() = default;
554+
553555
ErrorOr<NonnullOwnPtr<ImageDecoderPlugin>> TinyVGImageDecoderPlugin::create(ReadonlyBytes bytes)
554556
{
555557
auto plugin = TRY(adopt_nonnull_own_or_enomem(new (nothrow) TinyVGImageDecoderPlugin(bytes)));

Userland/Libraries/LibGfx/ImageFormats/TinyVGLoader.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class TinyVGImageDecoderPlugin final : public ImageDecoderPlugin {
8686
virtual NaturalFrameFormat natural_frame_format() const override { return NaturalFrameFormat::Vector; }
8787
virtual ErrorOr<VectorImageFrameDescriptor> vector_frame(size_t index) override;
8888

89-
virtual ~TinyVGImageDecoderPlugin() override = default;
89+
virtual ~TinyVGImageDecoderPlugin() override;
9090

9191
private:
9292
TinyVGImageDecoderPlugin(ReadonlyBytes);

Userland/Libraries/LibJS/CyclicModule.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ CyclicModule::CyclicModule(Realm& realm, StringView filename, bool has_top_level
2424
{
2525
}
2626

27+
CyclicModule::~CyclicModule() = default;
28+
2729
void CyclicModule::visit_edges(Cell::Visitor& visitor)
2830
{
2931
Base::visit_edges(visitor);

Userland/Libraries/LibJS/CyclicModule.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ class CyclicModule : public Module {
2929
JS_DECLARE_ALLOCATOR(CyclicModule);
3030

3131
public:
32+
virtual ~CyclicModule() override;
33+
3234
// Note: Do not call these methods directly unless you are HostResolveImportedModule.
3335
// Badges cannot be used because other hosts must be able to call this (and it is called recursively)
3436
virtual ThrowCompletionOr<void> link(VM& vm) override final;

Userland/Libraries/LibJS/Runtime/AsyncGenerator.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ AsyncGenerator::AsyncGenerator(Realm&, Object& prototype, NonnullOwnPtr<Executio
3434
{
3535
}
3636

37+
AsyncGenerator::~AsyncGenerator() = default;
38+
3739
void AsyncGenerator::visit_edges(Cell::Visitor& visitor)
3840
{
3941
Base::visit_edges(visitor);

Userland/Libraries/LibJS/Runtime/AsyncGenerator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class AsyncGenerator final : public Object {
3131

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

34-
virtual ~AsyncGenerator() override = default;
34+
virtual ~AsyncGenerator() override;
3535

3636
void async_generator_enqueue(Completion, NonnullGCPtr<PromiseCapability>);
3737
ThrowCompletionOr<void> resume(VM&, Completion completion);

Userland/Libraries/LibJS/SourceTextModule.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ SourceTextModule::SourceTextModule(Realm& realm, StringView filename, Script::Ho
116116
{
117117
}
118118

119+
SourceTextModule::~SourceTextModule() = default;
120+
119121
void SourceTextModule::visit_edges(Cell::Visitor& visitor)
120122
{
121123
Base::visit_edges(visitor);

Userland/Libraries/LibJS/SourceTextModule.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ class SourceTextModule final : public CyclicModule {
1919
JS_DECLARE_ALLOCATOR(SourceTextModule);
2020

2121
public:
22+
virtual ~SourceTextModule() override;
23+
2224
static Result<NonnullGCPtr<SourceTextModule>, Vector<ParserError>> parse(StringView source_text, Realm&, StringView filename = {}, Script::HostDefined* host_defined = nullptr);
2325

2426
Program const& parse_node() const { return *m_ecmascript_code; }

Userland/Libraries/LibProtocol/RequestClient.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ RequestClient::RequestClient(NonnullOwnPtr<Core::LocalSocket> socket)
1414
{
1515
}
1616

17+
RequestClient::~RequestClient() = default;
18+
1719
void RequestClient::die()
1820
{
1921
// FIXME: Gracefully handle this, or relaunch and reconnect to RequestServer.

Userland/Libraries/LibProtocol/RequestClient.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class RequestClient final
2525

2626
public:
2727
explicit RequestClient(NonnullOwnPtr<Core::LocalSocket>);
28+
virtual ~RequestClient() override;
2829

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

Userland/Libraries/LibWeb/CSS/FontFace.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,8 @@ FontFace::FontFace(JS::Realm& realm, JS::NonnullGCPtr<WebIDL::Promise> font_stat
198198
m_status = Bindings::FontFaceLoadStatus::Error;
199199
}
200200

201+
FontFace::~FontFace() = default;
202+
201203
void FontFace::initialize(JS::Realm& realm)
202204
{
203205
Base::initialize(realm);

Userland/Libraries/LibWeb/CSS/FontFace.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class FontFace final : public Bindings::PlatformObject {
3535
using FontFaceSource = Variant<String, JS::Handle<WebIDL::BufferSource>>;
3636

3737
[[nodiscard]] static JS::NonnullGCPtr<FontFace> construct_impl(JS::Realm&, String family, FontFaceSource source, FontFaceDescriptors const& descriptors);
38-
virtual ~FontFace() override = default;
38+
virtual ~FontFace() override;
3939

4040
String family() const { return m_family; }
4141
WebIDL::ExceptionOr<void> set_family(String const&);

Userland/Libraries/LibWeb/CSS/StyleValues/ImageStyleValue.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ ImageStyleValue::ImageStyleValue(URL::URL const& url)
2626
{
2727
}
2828

29+
ImageStyleValue::~ImageStyleValue() = default;
30+
2931
void ImageStyleValue::load_any_resources(DOM::Document& document)
3032
{
3133
if (m_image_request)

Userland/Libraries/LibWeb/CSS/StyleValues/ImageStyleValue.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class ImageStyleValue final
2626
{
2727
return adopt_ref(*new (nothrow) ImageStyleValue(url));
2828
}
29-
virtual ~ImageStyleValue() override = default;
29+
virtual ~ImageStyleValue() override;
3030

3131
void visit_edges(JS::Cell::Visitor& visitor) const
3232
{

Userland/Services/WebContent/ConnectionFromClient.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ ConnectionFromClient::ConnectionFromClient(NonnullOwnPtr<Core::LocalSocket> sock
6262
async_notify_process_information({ ::getpid() });
6363
}
6464

65+
ConnectionFromClient::~ConnectionFromClient() = default;
66+
6567
void ConnectionFromClient::die()
6668
{
6769
Web::Platform::EventLoopPlugin::the().quit();

Userland/Services/WebContent/ConnectionFromClient.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class ConnectionFromClient final
3232
C_OBJECT(ConnectionFromClient);
3333

3434
public:
35-
~ConnectionFromClient() override = default;
35+
~ConnectionFromClient() override;
3636

3737
virtual void die() override;
3838

Userland/Services/WebContent/PageClient.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ PageClient::PageClient(PageHost& owner, u64 id)
7575
#endif
7676
}
7777

78+
PageClient::~PageClient() = default;
79+
7880
void PageClient::schedule_repaint()
7981
{
8082
if (m_paint_state != PaintState::Ready) {

Userland/Services/WebContent/PageClient.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ class PageClient final : public Web::PageClient {
2929
public:
3030
static JS::NonnullGCPtr<PageClient> create(JS::VM& vm, PageHost& page_host, u64 id);
3131

32+
virtual ~PageClient() override;
33+
3234
static void set_use_gpu_painter();
3335
static void set_use_experimental_cpu_transform_support();
3436

0 commit comments

Comments
 (0)