[PATCH] D120956: [clang][AST matchers] new AST matcher argumentsGivenCountIs(n) that checks the actual number of arguments given in a function call

Alister Johnson via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 15 17:12:22 PDT 2022


ajohnson-uoregon added inline comments.


================
Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:4452
+/// \endcode
+AST_POLYMORPHIC_MATCHER_P(argumentsGivenCountIs,
+                          AST_POLYMORPHIC_SUPPORTED_TYPES(
----------------
aaron.ballman wrote:
> I have a preference for `argumentCountAsWrittenIs()` -- we often use "as written" to distinguish syntax from semantics, and in the case of default arguments, the semantics are that the default arguments are treated as if they were given at the call site, so I would expect `argumentsGivenCountIs(2)` to match both calls to `f()`.
Ah that's a good point, and I like that name much better, I will update that.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120956



More information about the cfe-commits mailing list