- Notifications
You must be signed in to change notification settings - Fork 15.3k
Closed as duplicate of#31860
Copy link
Labels
check-requestRequest for a new check in clang-tidyRequest for a new check in clang-tidyclang-tidyduplicateResolved as duplicateResolved as duplicategood first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contribute
Description
It would be good to have a check that converts yoda conditions into normal conditions, as read into plain English from left to right.
Example:
if (0 == foo()) {}should be converted into:
if (foo() == 0) {}In 2025, accidental assignments should no longer be a thing, tools have caught up. Compilers warn about it via -Wparentheses, active by default in Clang and via -Wall in GCC.
vbvictor
Metadata
Metadata
Assignees
Labels
check-requestRequest for a new check in clang-tidyRequest for a new check in clang-tidyclang-tidyduplicateResolved as duplicateResolved as duplicategood first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contribute