Open techee opened 8 years ago
Heh... the problem here is that the file uses the preprocessor to generate statements and we don't have a real preprocessor. All I can do, probably, is refuse to emit types that contain too many tokens.
Another thing we could attempt in the future would be to apply some preprocessing: capture macro names and either expand them properly (hard) or just replace them with a space (simple). It would probably fix this case. Obviously other cases with macros defined in different files would be still hopeless.
Heh... the problem here is that the file uses the preprocessor to generate statements and we don't have a real preprocessor. All I can do, probably, is refuse to emit types that contain too many tokens.
The problem is that macros are skipped completely so here the cxx compiler thinks that
GENERATE_PERMUTATIONS_3_EVENTS
is immediately before reset_locks
which isn't the case. So IMO what the compiler should do is that the token chain that is used for typename should be cut off at the nearest macro definition and not to contain anything before it.
Another thing we could attempt in the future would be to apply some preprocessing: capture macro names and either expand them properly (hard) or just replace them with a space (simple). It would probably fix this case. Obviously other cases with macros defined in different files would be still hopeless.
Trying to do macro expansion doesn't probably make sense indeed as they can be stored in another file.
See https://github.com/universal-ctags/ctags/issues/80. We can give tags file as an input for ctags.
Is -I
option helpful?
Do you agree with this milestone setting?
It looks the compiler can get confused and here
https://github.com/universal-ctags/ctags/blob/master/parsers/cxx/cxx_tag.c#L323
it can generate tokens with huge strings. For instance, for
https://github.com/torvalds/linux/blob/master/lib/locking-selftest.c
I get typeref in one tag like
Other good files to try are these from the boost library:
Originally reported in #1111