[clang-tools-extra] [clang-tidy] Fix identifier-naming style lookup in macro arguments (PR #206809)

Zeyi Xu via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 2 04:52:03 PDT 2026


================
@@ -0,0 +1,23 @@
+// RUN: %check_clang_tidy %s readability-identifier-naming %t -- \
+// RUN:   -config='{CheckOptions: { \
+// RUN:     readability-identifier-naming.FunctionCase: camelBack, \
+// RUN:     readability-identifier-naming.ParameterCase: camelBack, \
+// RUN:     readability-identifier-naming.VariableCase: camelBack \
+// RUN:   }}'
+
+#define WRAP(E) E
+
+WRAP(int foo(int v) { return v; })
+
+void testLambdaInMacroArgument() {
+  WRAP([](int var) {
+    return var;
+  }(1));
+}
+
+int badFunction(int BadParam) {
+  // CHECK-MESSAGES: :[[@LINE-1]]:21: warning: invalid case style for parameter 'BadParam' [readability-identifier-naming]
----------------
zeyi2 wrote:

```suggestion
  // CHECK-MESSAGES: :[[@LINE-1]]:21: warning: invalid case style for parameter 'BadParam'
```

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


More information about the cfe-commits mailing list