[PATCH] D57787: [clang-tidy] modernize-avoid-c-arrays: avoid main function (PR40604)

Roman Lebedev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 5 23:48:44 PST 2019


lebedev.ri added inline comments.


================
Comment at: clang-tidy/modernize/AvoidCArraysCheck.cpp:35
+  const clang::DeclContext *DC = Node.getDeclContext();
+  const clang::FunctionDecl *FD = llvm::dyn_cast<clang::FunctionDecl>(DC);
+  if (!FD)
----------------
JonasToth wrote:
> There is `FunctionDecl->castToDeclContext()` which is probably a better fit here.
I'm guessing you meant `cast*From*DeclContext()`.
Interesting, that function is never once used.
And it uses `static_cast<>()`..


Repository:
  rCTE Clang Tools Extra

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57787/new/

https://reviews.llvm.org/D57787





More information about the cfe-commits mailing list