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

Fix destructors should be public virtual #210

Open
wants to merge 1 commit into
base: noetic-devel
Choose a base branch
from

Conversation

Rayman
Copy link

@Rayman Rayman commented Dec 7, 2023

I encountered some compilation errors with clang. It complains that the destructor is not virtual. According to the cpp core guidelines a destructor should be either public and virtual or protected and non virtual. See also this link:
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#c35-a-base-class-destructor-should-be-either-public-and-virtual-or-protected-and-non-virtual

I encountered some compilation errors with clang. It complains that the
destructor is not virtual. According to the cpp core guidelines a
destructor should be either public and virtual or protected and non
virtual. See also this link:
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#c35-a-base-class-destructor-should-be-either-public-and-virtual-or-protected-and-non-virtual
Copy link
Contributor

@sloretz sloretz left a comment

Choose a reason for hiding this comment

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

Thank you for the PR!

@@ -69,7 +69,7 @@ class JointStateListener {


/// Destructor
~JointStateListener();
virtual ~JointStateListener();
Copy link
Contributor

Choose a reason for hiding this comment

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

This makes sense, but I think making it virtual will break ABI. We try to avoid breaking ABI in released distros. Would you be willing to make the destructor protected instead?

@ahcorde ahcorde added the ros1 label Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants