[PATCH] D142800: [Clang][Diagnostic] Add `-Wcomparison-op-parentheses` to warn on chained comparisons

David Blaikie via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 31 10:40:43 PST 2023


dblaikie added a comment.

> I'd be interested to see the fixit-hints for the first bit, also to see how others feel about it here.

My 2c is that `-Wparentheses` is already a very stylistic warning (even correct code, without knowing about this esoteric/specific suppression style of adding parens, is likely to be caught by this general class of diagnostic) so I'm pretty apprehensive about opening it up further - but data would be the decider. Running the proposed slices (different operators in different orders, etc) of warning over some broad codebases to get a sense of the false positive rate would be really helpful/necessary to decide which things to include and exclude.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142800/new/

https://reviews.llvm.org/D142800



More information about the cfe-commits mailing list