[clang-tools-extra] [clang-tidy] Add bugprone-macro-condition check (PR #210768)

via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 20 12:01:33 PDT 2026


================
@@ -0,0 +1,34 @@
+//===--- MacroConditionCheck.h - clang-tidy ---------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_MACROCONDITIONCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_MACROCONDITIONCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// Warns about inconsistent macro usage in preprocessor conditions.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-macro-condition.html
----------------
EugeneZelenko wrote:

```suggestion
/// https://clang.llvm.org/extra/clang-tidy/checks/bugprone-macro-condition.html
```

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


More information about the cfe-commits mailing list