Skip to content
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

Definition of fail_fast and of narrowing_error triggers clang's -Wweak-vtables #322

Closed
mrahn opened this issue Feb 9, 2022 · 2 comments · Fixed by #332
Closed

Definition of fail_fast and of narrowing_error triggers clang's -Wweak-vtables #322

mrahn opened this issue Feb 9, 2022 · 2 comments · Fixed by #332

Comments

@mrahn
Copy link

mrahn commented Feb 9, 2022

As fail_fast and narrowing_error are deriving from std::logic_error and from std::exception respectively, they both have a vtable. In a header-only library there is no compilation unit, which implies the vtables are emitted in every client compilation unit, putting burden to the linker to understand this is not a duplicate definition. That is what the warning is about.

Solution

  • Disable the warning locally.

Alternatives:

References:

@mbeutel
Copy link
Collaborator

mbeutel commented Feb 9, 2022

Thanks for the diligent bug report :) I will address this problem as soon as time allows.

mbeutel added a commit that referenced this issue Apr 9, 2023
…wirew0rm)

* Enable "-Wweak-vtables" warning for Clang and "-Wuseless-cast" for GCC
* Suppress these warnings inside gsl-lite.hpp for Clang and GCC
* Sneak in some drive-by comment updates

Fixes #322 and #325.
@mbeutel
Copy link
Collaborator

mbeutel commented Apr 9, 2023

This should now be fixed. I'm sorry it took so long.

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 a pull request may close this issue.

2 participants