[clang-tools-extra] [clang-tidy] Add readability-constant-operand-order check (PR #167158)

Victor Chernyakin via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 9 16:22:34 PST 2025


================
@@ -0,0 +1,31 @@
+// RUN: %check_clang_tidy %s readability-constant-operand-order %t -- -- -std=c++17
+// RUN: %check_clang_tidy %s readability-constant-operand-order %t -- -check-suffixes=LEFT -- -config="{CheckOptions:[{key: readability-constant-operand-order.PreferredConstantSide, value: Left}, {key: readability-constant-operand-order.BinaryOperators, value: '==,!='}]}" -- -std=c++17
----------------
localspook wrote:

```suggestion
// RUN: %check_clang_tidy %s readability-constant-operand-order %t
// RUN: %check_clang_tidy %s readability-constant-operand-order -check-suffixes=LEFT %t -- -config="{CheckOptions:[{key: readability-constant-operand-order.PreferredConstantSide, value: Left}, {key: readability-constant-operand-order.BinaryOperators, value: '==,!='}]}"
```


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


More information about the cfe-commits mailing list