[PATCH] D73098: [clang-tidy] readability-identifier-naming disregards parameters restrictions on main like functions
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 21 14:05:52 PST 2020
aaron.ballman added inline comments.
================
Comment at: clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp:474
if (const auto *Decl = dyn_cast<ParmVarDecl>(D)) {
+ if (isParamInMainLikeFunction(*Decl))
+ return SK_Invalid;
----------------
I think a better approach may be to look at the `DeclContext` for the `ParmVarDecl` object to see if it is a `FunctionDecl`, and if it is, call `FunctionDecl::isMain()` to check.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D73098/new/
https://reviews.llvm.org/D73098
More information about the cfe-commits
mailing list