-
Notifications
You must be signed in to change notification settings - Fork 1.9k
C++: update test output following extractor template fix #630
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
Conversation
jbj
left a comment
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.
It seems fine to me that a type argument to a template is normalised slightly to remove a pointless const. I suppose the same will now happen for a const int argument.
What happens if there's also a G<const int *> instantiation? Does that become a separate class but with the same template argument? Or will it be the same class as G<const int *const> and have two names? And how many bodies?
|
If you add a |
|
That's probably the least bad of the two possibilities. |
dave-bartolomeo
left a comment
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.
Wait, what's the extractor change that causes this? G<const int*const> and G<const int*> are two different specializations of the template in C++. It's function parameters that ignore top-level const, not template arguments.
For a real-world example, std::unique_ptr<int> is an int* that gets deleted when it goes out of scope, and std::unique_ptr<const int> is a const int* that gets deleted when it goes out of scope.
|
This is not a desirable change, it's just an unfortunate side-effect of us struggling to work around an issue extracting instantiations like |
dave-bartolomeo
left a comment
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.
OK, it sounds like we're still keeping them as separate classes, but with top-level const incorrectly stripped from the template argument. That's still not good, but it's probably less likely to cause problems than having them as the same class. Is there a Jira ticket still open to figure out the right extractor fix post-1.19?
|
Should this be closed now? |
|
Yes, @ian-semmle figured out the correct extractor fix that keeps the correct output for this test. |
No description provided.