Issue 80850
Summary Create readability-math-missing-parentheses check
Labels clang-tidy, check-request
Assignees
Reporter PiotrZSL
    I'm adding this here so, i woudn't forget.
Create check that detect missing () around mathematical expressions when operators of different priority are used.

```
int main()
{
    return 2 + 2 * 2;
}
```

Should be:
```
int main()
{
    return 2 + (2 * 2);
}
```

Similar thing for other math operators.
Main purpose is to explicitly show evaluation order.
Consider adding option to skip constructions that properly handled from left to right like: `2 * 2 + 2`.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to