Commit Graph

7 Commits

Author SHA1 Message Date
Richard Trieu cbab79a4f8 Check for bool-like conversion in conditional expressions.
Add a check for bool-like conversions for the condition expression of
conditional operators.  This is similiar to the checking of condition
expressions of if statements, for-loops, while-loops, and do-while loops.
Specificially, this is to fix the problem of assert("message") not triggering
-Wstring-conversion when the assert macro uses a conditional operator.

llvm-svn: 237856
2015-05-20 23:29:18 +00:00
Fariborz Jahanian c362aedffb Simplify test for rdar://19256338
(from patch r224549).

llvm-svn: 224713
2014-12-22 17:54:25 +00:00
Fariborz Jahanian 0fc95ad758 [c Sema]. Patch fixes pointer-bool-conversion warning on C code
when source range is incorrect causing the warning to be
issued when it should not because expression is in a macro.
rdar://19256338

llvm-svn: 224549
2014-12-18 23:14:51 +00:00
Fariborz Jahanian b7859ddf9b [Sema]. Warn when logical expression is a pointer
which evaluates to true. rdar://18716393.
Reviewed by Richard Trieu

llvm-svn: 222009
2014-11-14 17:12:50 +00:00
Fariborz Jahanian 902edb9a2b Remove this test too.
llvm-svn: 221715
2014-11-11 21:54:53 +00:00
Fariborz Jahanian 3365bfc609 Revert r221702 until I address Richard Trieu's
comments.

llvm-svn: 221714
2014-11-11 21:54:19 +00:00
Fariborz Jahanian c5fd4844da Patch to warn when logical evaluation of operand evalutes to a true value;
That this is a c-only patch. c++ already has this warning.
This addresses rdar://18716393

llvm-svn: 221702
2014-11-11 19:59:16 +00:00