[clang-tools-extra] [clang-tidy] Add check 'bugprone-assignment-in-selection-statement' (PR #180219)

Yanzuo Liu via cfe-commits cfe-commits at lists.llvm.org
Sat Feb 7 22:48:53 PST 2026


=?utf-8?q?Bal=C3=A1zs_K=C3=A9ri?= <balazs.keri at ericsson.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/180219 at github.com>


================
@@ -0,0 +1,55 @@
+.. title:: clang-tidy - bugprone-assignment-in-selection-statement
+
+bugprone-assignment-in-selection-statement
+==========================================
+
+Finds assignments within selection statements.
+Such assignments may indicate programmer error because they may have been
+intended as equality tests. The selection statements are conditions of ``if``
+and loop (``for``, ``while``, ``do``) statements, condition of conditional
----------------
zwuis wrote:

Conditional operator is another name of `? :`.

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


More information about the cfe-commits mailing list