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

CustomTags has a virtual destructor #402

Closed
wants to merge 1 commit into from

Conversation

mvanslobbe
Copy link

When compiling with '-Wnon-virtual-dtor' the current code will lead to

Common.h:214:7: warning: 'quill::CustomTags' has virtual functions but non-virtual destructor [-Wnon-virtual-dtor]
class CustomTags

This fixes that.

@odygrd
Copy link
Owner

odygrd commented Mar 14, 2024

Hey, thanks for the PR.
How are you using custom_tags ?

It has to be used as in this example
https://github.com/odygrd/quill/blob/master/examples/example_custom_tags.cpp#L39

If you add the virtual destructor then it doesn't compile anymore.

e.g.

example_custom_tags.cpp:39:32: error: the type ‘const MyCustomTagsA’ of ‘constexpr’ variable ‘custom_tags_a’ is not literal
   39 | static constexpr MyCustomTagsA custom_tags_a{"CUSTOM_TAG_A", 12};

It seems that instead of adding a virtual dtor, we need to ignore this warning for this class

@odygrd
Copy link
Owner

odygrd commented Mar 15, 2024

moving this to #405

@odygrd odygrd closed this Mar 15, 2024
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.

2 participants