[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

Julian Schmidt via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 26 05:40:53 PDT 2024


================
@@ -0,0 +1,25 @@
+.. title:: clang-tidy - readability-math-missing-parentheses
+
+readability-math-missing-parentheses
+====================================
+
+Check for missing parentheses in mathematical expressions that involve operators
+of different priorities. Parentheses in mathematical expressions clarify the order
+of operations, especially with different-priority operators. Lengthy or multiline
+expressions can obscure this order, leading to coding errors. IDEs can aid clarity
+by highlighting parentheses. Explicitly using parentheses also clarify what the 
----------------
5chmidti wrote:

Maybe I didn't select the correct lines, given that GitHub shows 4 lines here, my bad. I only meant the second `clarify`, not both.
- `Parentheses in mathematical expressions clarify`
- `Explicitly using parentheses also clarifies`

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


More information about the cfe-commits mailing list