-
Notifications
You must be signed in to change notification settings - Fork 382
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
Regex on symbol names doesn't seem to quite work #233
Comments
Regexes aren't supposed to work for symbols. I guess it could be made to work, but that would mean you'd have to keep a map from regex -> target symbol, and evaluate every symbol against every key in that map, which seems pretty costly. There's some specialized handling of regexes for include mappings, but I don't know the details there. It looks like they're expanded to all matching headers before IWYU analysis begins. |
the documentation says:
(from https://code.google.com/p/include-what-you-use/wiki/IWYUMappings) And it'd be nice if it did work, because following header files for QT is a nightmare (QList::toSet ends you up in qset.h, which may be sensible, but it's not what the documentation says!) So you end up with an awful lot of symbol mappings anyway. |
Thinking about that it strikes me as likely that subclasses of classes would be in the same header. That is to say that for any class |
I just encountered this issue as well. Regex symbol matching would be nice, but unless that is coming soon it would be very helpful to fix the incorrect documentation in |
I agree with @ThosRTanner that proper handling of nested types makes all our use cases of regex symbol mappings disappear. I created #451. I think this issue can be closed. Note that it is possible to forward declare nested types:
And then defining the type in a different header:
So, the symbols But: if there is a mapping for |
@ThosRTanner, if you agree, can you close this issue? Thanks. |
Given this:
QDir
qdir.h
test.cc
And this mapping file:
I get told I should add
#include "qdir.h"
forQDir::Filters
. I've tried pretty much everything, and the only way I can get it to behave is to specify the full name rather than using a regex in the second mapping entry. (I was hoping to have one entry, @qdir(::.*)?The text was updated successfully, but these errors were encountered: