[clang-tools-extra] [clang-tidy] Ignore non-forwarded arguments if they are unnamed (PR #87832)

Piotr Zegar via cfe-commits cfe-commits at lists.llvm.org
Sun Apr 7 00:17:20 PDT 2024


Danny =?utf-8?q?Mösch?= <danny.moesch at icloud.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/87832 at github.com>


================
@@ -79,6 +79,8 @@ AST_MATCHER_P(LambdaExpr, hasCaptureDefaultKind, LambdaCaptureDefault, Kind) {
   return Node.getCaptureDefault() == Kind;
 }
 
+AST_MATCHER(ParmVarDecl, hasAnyName) { return !Node.getName().empty(); }
----------------
PiotrZSL wrote:

use just [getIdentifier](https://clang.llvm.org/doxygen/classclang_1_1NamedDecl.html#a1475b4e0cfc82be122ba166894f68705)() as getName got assert inside, and change name, simply because we have matcher of such name already, so maybe something like `hasIdentifier`

https://github.com/llvm/llvm-project/pull/87832


More information about the cfe-commits mailing list