Visitar URL original
Fix -Wsuggest-destructor-override for generated C++ proto classes. by PatriosTheGreat · Pull Request #8408 · protocolbuffers/protobuf · GitHub
Skip to content

Fix -Wsuggest-destructor-override for generated C++ proto classes. - #8408

Merged
acozzette merged 1 commit into
protocolbuffers:masterfrom
PatriosTheGreat:master
Mar 18, 2021
Merged

acozzette merged 1 commit into
protocolbuffers:masterfrom
PatriosTheGreat:master

Conversation

@PatriosTheGreat

Copy link
Copy Markdown
Contributor

Since proto objects inherits Message class with virtual destructor, they need to override it.

This warning was introduced by clang-11 compiler.

format(
"inline $classname$() : $classname$(nullptr) {}\n"
"virtual ~$classname$();\n"
"virtual ~$classname$() override;\n"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think as long as we're adding override we can drop the virtual keyword since that is implied. One other thing is would you mind running ./generate_descriptor_proto.sh? That will rebuild the checked-in pb.h and pb.cc files.

@acozzette
acozzette merged commit f579403 into protocolbuffers:master Mar 18, 2021
@acozzette

Copy link
Copy Markdown
Collaborator

Thanks, @PatriosTheGreat.

bithium pushed a commit to bithium/protobuf that referenced this pull request Sep 4, 2023
Fix -Wsuggest-destructor-override for generated C++ proto classes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants