[clang-tools-extra] [clang-tidy] Ignore expresions in unevaluated context in bugprone-inc-dec-in-conditions (PR #85849)

Julian Schmidt via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 22 15:25:56 PDT 2024


https://github.com/5chmidti requested changes to this pull request.

Looks good, but the `operand` node may also be in an unevaluated context, you only guard against the non `++/--` expr being in an unevaluated context here. 
Fix: add `unless(IsInUnevaluatedContext)` to both `expr().bind("operand")`.
Example: `if (foo < static_cast<decltype(foo++)>(bar)) {}`

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


More information about the cfe-commits mailing list