[clang-tools-extra] [clang-tidy] Add UnusedIncludes/MissingIncludes options to misc-include-cleaner (PR #140600)

Baranov Victor via cfe-commits cfe-commits at lists.llvm.org
Tue May 20 07:05:36 PDT 2025


================
@@ -0,0 +1,13 @@
+// RUN: %check_clang_tidy %s misc-include-cleaner %t \
+// RUN: -config='{CheckOptions: \
+// RUN:  {"misc-include-cleaner.UnusedIncludes": false,\
+// RUN:   "misc-include-cleaner.MissingIncludes": false,\
+// RUN:  }}' -- -fno-delayed-template-parsing
+
+// CHECK-MESSAGES: warning: The check 'misc-include-cleaner' will not perform any analysis because 'UnusedIncludes' and 'MissingIncludes' are both false. [clang-tidy-config]
+
+void g() {
+    int p_local0 = 42;
+    // CHECK-FIXES-NOT: int const p_local0 = 42;
+  }
+  
----------------
vbvictor wrote:

Please add a newline

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


More information about the cfe-commits mailing list