[clang-tools-extra] [llvm] [clang-tidy] Fix missing parentheses in readability-implicit-bool-conversion fixes (PR #74891)

Piotr Zegar via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 15 10:52:52 PST 2024


PiotrZSL wrote:

The thing with OO_New and other was that when i merged code and extracted areParensNeededForStatement simple because I know that it will be needed for other checks I based it more on https://en.cppreference.com/w/cpp/language/operator_precedence. But there many operators are in same group, and information that is +- missing is an new parent operator. In future maybe areParensNeededForStatement will be extended to cover both old and new parent operator and provide more accurate hints. To avoid potential issues I put those OO_New and other on list that they need (), simply because that don't cause any problems, and to be honest there are not many use-cases and most of them are invalid anyway from a user perspective (like implicit casting of newly allocated memory to bool).

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


More information about the cfe-commits mailing list