-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
[registration] Remove deprecated method Registration::setInputCloud()
from public API
#4026
[registration] Remove deprecated method Registration::setInputCloud()
from public API
#4026
Conversation
cea1971
to
a45d448
Compare
I'm not sure that this doesn't break behavior of downstream users in subtle ways. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only see a potential of this breaking downstream project in a non-subtle way :)
Merge at your convenience if the CI is green. |
d8e1dfd
to
375b638
Compare
According to this, deleting a virtual function in deriving classes is not allowed by the standard. Changing visibility (as originally proposed by @kunaltyagi) is one of the listed workarounds. Another one is to add a |
I tested out a snippet in Godbolt and it didn't throw an error. Please show me the error in my ways 😆. A valid snippet would be very welcome indeed. |
Your example was broken. You cannot have a templated virtual function, so the function you declared was not overriding the original one. See the modified snippet https://godbolt.org/z/LdkanP |
See snippet |
I took another look at the SO thread and the associated comments and they flag that the method can still be called from the base class, with the static_assert option. This happens because we're redefining the method in the derived class, not really overriding it. Both solutions on the table (static assert and moving th private) suffer from the same, there's no way to prevent the call from a base pointer, because the base pointer has the method implemented. Given the circumstances I vote to move it to private but keep the original implementation we deleted. There's no point in having a static deprecated warning because we'll never be able to delete the method properly, so we should just throw that warning at runtime. Then again, if a user is gonna keep around a vector of base class pointers, I believe logically we would store |
375b638
to
a864e56
Compare
PTAL. Updated to use private + runtime warning. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if CI == green: 🚀
setInputCloud
from public APIRegistration::setInputCloud()
from public API
Fixes #2724 by making compiler emit compile error if previously deprecated method is used