[clang-tools-extra] [clang-tidy] Add check 'bugprone-assignment-in-selection-statement' (PR #180219)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Feb 13 07:08:36 PST 2026
=?utf-8?q?Balázs_Kéri?= <balazs.keri at ericsson.com>,
=?utf-8?q?Balázs_Kéri?= <balazs.keri at ericsson.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/180219 at github.com>
github-actions[bot] wrote:
<!--LLVM CODE LINT COMMENT: clang-tidy-->
:warning: C/C++ code linter, clang-tidy found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
```bash
git diff -U0 origin/main...HEAD -- clang-tools-extra/clang-tidy/bugprone/AssignmentInSelectionStatementCheck.cpp clang-tools-extra/clang-tidy/bugprone/AssignmentInSelectionStatementCheck.h clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp |
python3 clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py -path build -p1 -quiet
```
</details>
<details>
<summary>
View the output from clang-tidy here.
</summary>
```
clang-tools-extra/clang-tidy/bugprone/AssignmentInSelectionStatementCheck.cpp:121:3: warning: variable 'CondStr' of type 'StringRef' can be declared 'const' [misc-const-correctness]
121 | StringRef CondStr =
| ^
| const
clang-tools-extra/clang-tidy/bugprone/AssignmentInSelectionStatementCheck.cpp:135:3: warning: variable 'OpLoc' of type 'SourceLocation' can be declared 'const' [misc-const-correctness]
135 | SourceLocation OpLoc =
| ^
| const
```
</details>
https://github.com/llvm/llvm-project/pull/180219
More information about the cfe-commits
mailing list