[PATCH] D63082: [Diagnostics] Added support for -Wint-in-bool-context

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 27 04:55:26 PDT 2019


aaron.ballman added a comment.

In terms of the code, I think this is ready to go. However, I'm still not happy with `'*' in boolean context` as a diagnostic. Perhaps appending something about the resulting value always being true|false would help most of these diagnostics be more obvious. `blah in boolean context will always evaluate to true|false` optionally followed by `; did you mean yada?` would make it more obvious what is wrong with the code.

Also, I'm not certain why this should be enabled by default when the other tautological comparison categories are not. I think it should follow the rest of the tautological comparisons in that regard, but I also would have expected those to be on by default. @rsmith, what are your opinions here?



================
Comment at: include/clang/Basic/DiagnosticGroups.td:767
 def IncompatibleExceptionSpec : DiagGroup<"incompatible-exception-spec">;
-
 def IntToVoidPointerCast : DiagGroup<"int-to-void-pointer-cast">;
----------------
Spurious change.


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

https://reviews.llvm.org/D63082





More information about the cfe-commits mailing list