diff options
| author | Fariborz Jahanian <fjahanian@apple.com> | 2014-12-18 23:14:51 +0000 |
|---|---|---|
| committer | Fariborz Jahanian <fjahanian@apple.com> | 2014-12-18 23:14:51 +0000 |
| commit | 0fc95ad7584eacbf5b82a4890709e54b44318351 (patch) | |
| tree | ed08146e587c6f11dd2a68a4bc3eea5d452cdc02 /clang/test/Sema | |
| parent | a2bd8d98a18e4927b247dc2443b2a63d0c0feb24 (diff) | |
| download | bcm5719-llvm-0fc95ad7584eacbf5b82a4890709e54b44318351.tar.gz bcm5719-llvm-0fc95ad7584eacbf5b82a4890709e54b44318351.zip | |
[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
Diffstat (limited to 'clang/test/Sema')
| -rw-r--r-- | clang/test/Sema/warn-tautological-compare.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/clang/test/Sema/warn-tautological-compare.c b/clang/test/Sema/warn-tautological-compare.c index 2856eddc7b0..247e7406398 100644 --- a/clang/test/Sema/warn-tautological-compare.c +++ b/clang/test/Sema/warn-tautological-compare.c @@ -77,4 +77,18 @@ void test3() { (!array && array[0])) {} // expected-warning {{address of array 'array' will always evaluate to 'true'}} } - +// rdar://19256338 +#define SAVE_READ(PTR, RESULT) if( (PTR) && *(PTR) ) *RESULT=*PTR; + +// Source +typedef unsigned char Boolean; +struct HTTPClientPrivate +{ + Boolean readSuspended; +}; +typedef struct HTTPClientPrivate * HTTPClientRef; +static void _HTTPClientErrorHandler( HTTPClientRef me) +{ + Boolean result; + SAVE_READ(&me->readSuspended, &result); +} |

