Skip to content

Conversation

@PatriosTheGreat
Copy link
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"

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

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