[PATCH] D99646: [clang-tidy] misc-avoid-std-io-outside-main: a new check
Marco Gartmann via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 13 23:35:12 PDT 2021
mgartmann added inline comments.
================
Comment at: clang-tools-extra/clang-tidy/misc/AvoidStdIoOutsideMainCheck.cpp:22
+ Finder->addMatcher(
+ declRefExpr(to(varDecl(hasAnyName("cin", "wcin", "cout", "wcout", "cerr",
+ "wcerr"),
----------------
Would there be a way to extract these names (`cin`, `cout`, ...) into a separate variable? In my opinion, this would make the AST matchers cleaner and easier to read.
E.g., I was not able to find an overload of `hasAnyName()` which takes a `std:.vector` as argument.
Looking forward to hearing from you.
Thanks for any feedback in advance.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D99646/new/
https://reviews.llvm.org/D99646
More information about the cfe-commits
mailing list