-
Notifications
You must be signed in to change notification settings - Fork 294
Remove IWYU False Positives From Other Namespaces #273
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
Remove IWYU False Positives From Other Namespaces #273
Conversation
Note that there is a regression for the example from #62. This might be OK, because an unqualified
|
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.
We shouldn't introduce a regression. Locally defined classes should not be IWYU'd.
Is there a preference on how we want to handle this? I'd like to have a simple check that is consistent. Right now the checks for The current check for The problem specifically with the name template <typename T>
struct Foo {
T t;
};
template <typename T>
Foo<T> map(T t) {
return Foo<T>{ t };
}
struct Bar {
};
auto res = map<Bar>(); That example, only has one template; but it would be reasonable to have multiple ones. One could be the functor. The other could be a function. If we want to go down the route of applying the check against 2+ template arguments, there are a couple of options.
Another set of options would be to look for a declaration with the same name in the same file. If the declaration is present, the check would be ignored. That might be difficult due to the most vexing parse. Also, it would miss declarations in other files. It seems like all the options have trade offs, but it would be good to have some clarity. |
ba02750
to
0ad09f5
Compare
0ad09f5
to
6440ff3
Compare
I made a change such that |
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.
Looks great!
oops, forgot the changelog part... |
Anyways, you don't need to force push here. We always squash on merge. |
Add changelog for cpplint#273, standardize the changelog's name to all-caps, stop vi favortism, and add some PR guidance to CONTRIBUTING.
Add changelog for #273, standardize the changelog's name to all-caps, stop vi favortism, and add some PR guidance to CONTRIBUTING. Co-authored-by: Aaron Liu <aaronliu0130@gmail.com>
This PR removes the false positives from
_HEADERS_CONTAINING_TEMPLATES
that come from nonstd
namespaces. Users of boost or other namespaces will no longer get false positives.