[PATCH] D74463: [clang-tidy] Add new check avoid-adjacent-unrelated-parameters-of-the-same-type
Nathan James via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Feb 16 05:31:24 PST 2020
njames93 added inline comments.
================
Comment at: clang-tools-extra/clang-tidy/cppcoreguidelines/AvoidAdjacentParametersOfTheSameTypeCheck.cpp:18
+namespace cppcoreguidelines {
+// FIXME: Make sure this matcher only accepts functions with minimum 2
+// parameters
----------------
njames93 wrote:
> You'd need to create a matcher for that
>
> ```
> AST_MATCHER(FunctionDecl, hasMoreThan2Args) {
> return Node.getNumParams() > 2;
> }
> ```
>
Sorry you'd need
```
AST_MATCHER(FunctionDecl, has2orMoreArgs) {
return Node.getNumParams() >= 2;
}
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D74463/new/
https://reviews.llvm.org/D74463
More information about the cfe-commits
mailing list