Skip to content

Fix Clang warnings for -Wweak-vtables #1254

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Mar 1, 2025
Merged

Fix Clang warnings for -Wweak-vtables #1254

merged 12 commits into from
Mar 1, 2025

Conversation

DanRStevens
Copy link
Collaborator

Ensure classes with virtual member functions have at least one out-of-line definition in their source file.

Related:

We already inherit a `virtual` destructor from `Window`. However, by providing an explicit `override` here, we now have a `virtual` member with an out-of-line definition, meaning the virtual function table can be emitted in only the translation unit that defines it. This removes an instance of the Clang warning `-Wweak-vtables`.
This creates out-of-line virtual method definitions. This removes an instance of the Clang warning `-Wweak-vtables`.
This creates an out-of-line virtual method definition. This removes an instance of the Clang warning `-Wweak-vtables`.
This creates an out-of-line virtual method definition. This removes an instance of the Clang warning `-Wweak-vtables`.

As we move more code into class constructors, the `initialize()` method here becomes less important. For simple classes, it should be optional to write an explicit override.
This creates an out-of-line virtual method definition. This removes an instance of the Clang warning `-Wweak-vtables`.
This creates out-of-line virtual method definitions. This removes an instance of the Clang warning `-Wweak-vtables`.
This removes instances of the Clange warning `-Wweak-vtables`.
This removes an instance of the Clange warning `-Wweak-vtables`.
@DanRStevens DanRStevens merged commit cee4ce7 into main Mar 1, 2025
8 checks passed
@DanRStevens DanRStevens deleted the weakVtables branch March 1, 2025 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant