[PATCH] D51949: [WIP][clang-tidy] initial ideas to isolate variable declarations
Jonas Toth via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 27 08:45:30 PDT 2018
JonasToth added a comment.
There are testcases with macro around line 100 in the default tests. I
am not sure yet if `#define I_DECLS int i1, i2, i3;` should be
diagnosed, but the other cases should.
Am 27.09.2018 um 16:28 schrieb Kirill Bobyrev via Phabricator:
> kbobyrev added a comment.
>
> Also, regarding error handling and `llvm::Option` vs `llvm::Expected`: I think the case where the check most likely wouldn't be able to provide useful diagnostics and perform enough analysis is when there are macro expansions within inspected statement `SourceRange`. It might make sense to completely disable it in this case both because it's hard to do anything about the range transformation and because it seems to be hard to analyze this case. E.g. if the whole statement is expanded from a single macro and then the check would report on every macro usage (while the actual problem is in the macro itself). I don't know whether the check should support macros at all, it might make sense to mention this in the documentation and add few tests if we decide to go this way.
>
> Repository:
>
> rCTE Clang Tools Extra
>
> https://reviews.llvm.org/D51949
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D51949
More information about the cfe-commits
mailing list