[PATCH] D53771: [clang-tidy] Avoid C arrays check

Jonas Toth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Nov 10 04:48:44 PST 2018

JonasToth added inline comments.

Comment at: clang-tidy/modernize/AvoidCArraysCheck.cpp:26
+  const clang::Type *TypeNode = Node.getTypePtr();
+  return (TypeNode != nullptr &&
+          InnerMatcher.matches(*TypeNode, Finder, Builder));
Nit: these parens are superflous

Comment at: clang-tidy/modernize/AvoidCArraysCheck.cpp:64
+  diag(ArrayType->getBeginLoc(),
+       isa<VariableArrayType>(ArrayType->getTypePtr()) ? UseVector : UseArray);
Why `isa<>` and not `isVariableArrayType()` (does it exist?)
`isa<>` would not resolve typedefs, but I think they should be considered.


More information about the cfe-commits mailing list