[clang-tools-extra] [clang-tidy] Add `IgnoreMacro` option to `bugprone-chained-comparison` (PR #171975)
Baranov Victor via cfe-commits
cfe-commits at lists.llvm.org
Fri Dec 12 02:47:40 PST 2025
================
@@ -0,0 +1,12 @@
+// RUN: %check_clang_tidy -std=c++98-or-later --extra-arg=-Wno-error=parentheses %s bugprone-chained-comparison %t -- -config="{CheckOptions: {bugprone-chained-comparison.IgnoreMacros: true}}"
+
+#define CHAINED_COMPARE(a, b, c) (a < b < c)
+
+void macro_test(int x, int y, int z) {
+ bool result = CHAINED_COMPARE(x, y, z);
+}
----------------
vbvictor wrote:
Thanks!
https://github.com/llvm/llvm-project/pull/171975
More information about the cfe-commits
mailing list