-
Notifications
You must be signed in to change notification settings - Fork 111
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
final-keyword #113
final-keyword #113
Conversation
… grand parent doesn't have a virtual destructor. This allows the code to be compiled by clang version 6.0 and above.
Looks like some tests are timing out. Could someone re-kick them or verify the test environment is correct? These tests are also failing in other PRs. |
thanks @jasonimercer for the improvement! Test failure is unrelated, retriggering CI now that the test failure has been fixed on master Just to confirm, this change does change ABI isn't it ? |
This would not result in an ABI change. If someone is creating a dynamic reconfigure message and then they are trying to inherit from it and they are on C+11 or better then this will result in a compilation error. This use-case is pretty specific though and I struggle to imagine what the intention would be. Generally if you want some custom data in a dynamic reconfigure you'll end up writing a new one rather than trying to re-use some fields. If the user wanted to re-use some fields then the language offers options such as templated functions. I've been using this branch at Clearpath for about 1/2 a year now without issue. It's nice to be able to crank up warnings an not get spammed by issues from upstream. I'd be happy to add to this commit and add some comments around the final keyword and where it's used in the source. If someone ever encounters an issue with it we can help them understand where they may have gone astray and offer some options inline. |
Yeah I agree that I haven't seen that use case around.
👍
That would be great for posterity. The code change looks good to me. |
The checks for I'll add a commit to the PR now with the inline comments on why there's a final keyword. |
As currently this branch is being used for all ROS distros we will need to keep the checks for now.
e2a2b34 lgtm, thanks! |
Add final keyword to child class since parent has virtual methods and grand parent doesn't have a virtual destructor (it's based on a .msg file). This allows the code to be compiled without warnings by pedantic compilers like clang 6.0 and above.
Has no impact on pre-C++11 compilers.
A minimal program to help understand this issue is as follows:
compiling this with clang-6.0 gives: