5 Commits

Author SHA1 Message Date
flovent
a12f4f0031
[clang-tidy] Add check for assignment or comparision operators' operand in readability-math-missing-parentheses (#141345)
Fixes false negative in #141249. 

Add check for math binary operators which are operands of assignment or
comparision operators.

Closes #141249.
2025-06-05 15:18:01 +03:00
Kazu Hirata
86f8be6a7c
[clang-tools-extra] Remove unused local variables (NFC) (#142881) 2025-06-04 22:43:59 -07:00
Piotr Zegar
d211abc625
[clang-tidy] Ignore non-math operators in readability-math-missing-parentheses (#94654)
Do not emit warnings for non-math operators.

Closes #92516
2024-06-09 09:01:41 +02:00
Julian Schmidt
fbe4d99132
[clang-tidy] fix false-negative for macros in readability-math-missing-parentheses (#90279)
When a binary operator is the last operand of a macro, the end location
that is past the `BinaryOperator` will be inside the macro and therefore
an
invalid location to insert a `FixIt` into, which is why the check bails
when encountering such a pattern.
However, the end location is only required for the `FixIt` and the
diagnostic can still be emitted, just without an attached fix.
2024-04-30 07:22:30 +02:00
Bhuminjay Soni
8dc7db7a24
[clang-tidy] Add clang-tidy check readability-math-missing-parentheses (#84481)
This commit closes #80850 where author suggests adding a
readability check to detect missing parentheses around mathematical
expressions when operators of different priorities are used.

Signed-off-by: 11happy <soni5happy@gmail.com>
2024-04-25 19:19:59 +02:00