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

Bhuminjay Soni via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 24 03:33:10 PDT 2024


================
@@ -0,0 +1,20 @@
+.. title:: clang-tidy - readability-math-missing-parentheses
+
+readability-math-missing-parentheses
+====================================
+
+Check for mising parantheses in mathematical expressions that involve operators
+of different priorities.
+
+Before:
+
+.. code-block:: c++
+
+  int x = 1 + 2 * 3 - 4 / 5;
+
+
+After:
+
+.. code-block:: c++
+
+  int x = (1 + (2 * 3)) - (4 / 5);
----------------
11happy wrote:

done

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


More information about the cfe-commits mailing list