aaron.ballman added inline comments.
================ Comment at: include/clang/Basic/DiagnosticSemaKinds.td:5609 +def warn_mul_in_bool_context : Warning< + "'*' in bool context, maybe you mean '&&'?">, + InGroup<IntInBoolContext>; ---------------- I would appreciate seeing some motivating examples for this case, because it seems like the `&&` suggestion is misleading more often than it's helpful in the current test cases. Also, what is a "bool context"? ================ Comment at: include/clang/Basic/DiagnosticSemaKinds.td:5625 + "evaluate to 'true'">, + InGroup<IntInBoolContext>; + ---------------- This one seems like it should be in the `TautologicalConstantCompare` group, no? ================ Comment at: lib/Sema/SemaChecking.cpp:11099 +static void DiagnoseIntInBoolContext(Sema &S, Expr *E) { + E = E->IgnoreParenImpCasts(); ---------------- `const Expr *E`? ================ Comment at: test/Sema/integer-overflow.c:37 // expected-warning@+1 2{{overflow in expression; result is 536870912 with type 'int'}} - overflow = 4608 * 1024 * 1024 ? 4608 * 1024 * 1024 : 0; + overflow = 4608 * 1024 * 1024 ? 4608 * 1024 * 1024 : 0; // expected-warning {{'*' in bool context, maybe you mean '&&'?}} ---------------- I don't think the new diagnostic adds a lot of value here, though GCC does warn on it similarly. Truthfully, the same goes for the other test cases in this file. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D63082/new/ https://reviews.llvm.org/D63082 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits