[clang-tools-extra] [clang-tidy] add readability-redundant-parentheses (PR #159911)
Baranov Victor via cfe-commits
cfe-commits at lists.llvm.org
Sat Sep 20 10:07:59 PDT 2025
vbvictor wrote:
> Clang-format has [an option like this](https://clang.llvm.org/docs/ClangFormatStyleOptions.html#removeparentheses) already. Unlike clang-format, we have full semantic information, so this check has the potential to be more reliable, but I’m concerned about duplicating functionality. What do you think?
I don't see a problem in duplicating functionality given `clang-tidy` would have fever false-positives.
We already have https://clang.llvm.org/docs/ClangFormatStyleOptions.html#insertbraces vs https://clang.llvm.org/extra/clang-tidy/checks/readability/braces-around-statements.html
Generally speaking, if `clang-format` option has warning `Setting this option to true could lead to incorrect code formatting due to clang-format’s lack of complete semantic information`, I doubt it will be ever enforced in CI but same `clang-tidy` check could be in CI.
https://github.com/llvm/llvm-project/pull/159911
More information about the cfe-commits
mailing list