[PATCH] D58878: [Diagnostics] Warn for assignments in bool contexts

2019-03-09 Thread John McCall via Phabricator via cfe-commits
rjmccall added inline comments. Comment at: include/clang/Basic/DiagnosticSemaKinds.td:6738 + "assignment to bool">, + InGroup; // Completely identical except off by default. xbolva00 wrote: > rjmccall wrote: > > Sorry, I didn't mean to suggest that you should

[PATCH] D58878: [Diagnostics] Warn for assignments in bool contexts

2019-03-09 Thread Dávid Bolvanský via Phabricator via cfe-commits
xbolva00 marked an inline comment as done. xbolva00 added inline comments. Comment at: include/clang/Basic/DiagnosticSemaKinds.td:6738 + "assignment to bool">, + InGroup; // Completely identical except off by default. rjmccall wrote: > Sorry, I didn't mean to

[PATCH] D58878: [Diagnostics] Warn for assignments in bool contexts

2019-03-07 Thread John McCall via Phabricator via cfe-commits
rjmccall added inline comments. Comment at: include/clang/Basic/DiagnosticGroups.td:699 def ParenthesesOnEquality : DiagGroup<"parentheses-equality">; +def AssigmentInBoolContext : DiagGroup<"assigment-in-bool-context">; def Parentheses : DiagGroup<"parentheses", --

[PATCH] D58878: [Diagnostics] Warn for assignments in bool contexts

2019-03-07 Thread Dávid Bolvanský via Phabricator via cfe-commits
xbolva00 added a comment. Addressed notes. Not sure why we miss _Bool warn3(int x, _Bool a) { return x = 0 || a; } in C mode :/ CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58878/new/ https://reviews.llvm.org/D58878 ___ cfe-commits m

[PATCH] D58878: [Diagnostics] Warn for assignments in bool contexts

2019-03-07 Thread Dávid Bolvanský via Phabricator via cfe-commits
xbolva00 updated this revision to Diff 189711. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58878/new/ https://reviews.llvm.org/D58878 Files: include/clang/Basic/DiagnosticGroups.td include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/SemaExprCXX.cpp test/CodeCompletion/crash-ski

[PATCH] D58878: [Diagnostics] Warn for assignments in bool contexts

2019-03-04 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. This seems eminently reasonable to warn about. I think people might legitimately complain about extending an existing warning to a new set of contexts without putting it under a new warning flag, though. How annoying would it be to clone the warnings and put them in

[PATCH] D58878: [Diagnostics] Warn for assignments in bool contexts

2019-03-02 Thread Dávid Bolvanský via Phabricator via cfe-commits
xbolva00 created this revision. xbolva00 added reviewers: RKSimon, aaron.ballman. Herald added subscribers: cfe-commits, jdoerfert. Herald added a project: clang. Follow up for (abandoned) patch https://reviews.llvm.org/D45401 Fixes https://bugs.llvm.org/show_bug.cgi?id=34180 Repository: rC Cl