[PATCH] D33841: [clang-tidy] redundant 'extern' keyword check
Daniel Kolozsvari via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 19 06:36:33 PDT 2019
koldaniel marked an inline comment as done.
koldaniel added inline comments.
================
Comment at: clang-tidy/readability/RedundantExternCheck.cpp:43-44
+
+ if (FD->getBeginLoc().isMacroID())
+ return;
+
----------------
lebedev.ri wrote:
> koldaniel wrote:
> > lebedev.ri wrote:
> > > Similarly, do this in `registerMatchers()`
> > Could you please help me how could I achieve that? I did not find any matchers which match for macros.
> You can simply add your own matchers, see e.g. `AST_MATCHER()`'s in `AvoidCArraysCheck.cpp`.
I see, I can update the checker based on your previous comment (move `if (FD->getStorageClass() != SC_Extern)` to `registerMatchers()`), but moving the macro check would disable the warning. We do not want to ignore the macro findings, we just don't want to apply fix-its.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D33841/new/
https://reviews.llvm.org/D33841
More information about the llvm-commits
mailing list