[clang-tools-extra] [clang-tidy][readability-redundant-parentheses] add option to prevent widely used work around (PR #164827)

Baranov Victor via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 23 09:49:58 PDT 2025


================
@@ -27,3 +27,16 @@ affect the semantics.
 .. code-block:: c++
 
   int a = (1 * 2) + 3; // no warning
+
+Options
+-------
+
+.. option:: AllowedDecls
+
+  A semicolon-separated list of names of declarations included variables and
+  functions to ignore when the parenthese around it.
+  The default is an `std::max;std::min`.
+  
+  Some std library functions may have the same name as widely used function-like
+  macro. For example, ``std::max`` and ``max`` macro. A work around to distinguish
+  them is adding parenthese around functions to prevent function-like macro.
----------------
vbvictor wrote:

```suggestion
  them is adding parentheses around functions to prevent function-like macro.
```

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


More information about the cfe-commits mailing list