Index: lib/Sema/SemaChecking.cpp =================================================================== --- lib/Sema/SemaChecking.cpp +++ lib/Sema/SemaChecking.cpp @@ -9933,7 +9933,7 @@ IsInAnyMacroBody(SM, Range.getBegin())) return; } - E = E->IgnoreImpCasts(); + E = E->IgnoreParenImpCasts(); const bool IsCompare = NullKind != Expr::NPCK_NotNull; Index: test/Sema/conditional-expr.c =================================================================== --- test/Sema/conditional-expr.c +++ test/Sema/conditional-expr.c @@ -79,9 +79,9 @@ (test0 ? (test0 ? adr2 : adr2) : nonconst_int); // expected-warning {{pointer type mismatch}} expected-warning {{expression result unused}} } -int Postgresql() { - char x; - return ((((&x) != ((void *) 0)) ? (*(&x) = ((char) 1)) : (void) ((void *) 0)), (unsigned long) ((void *) 0)); // expected-warning {{C99 forbids conditional expressions with only one void side}} +int Postgresql(char *x) { + //char x; + return (((x != ((void *) 0)) ? (*x = ((char) 1)) : (void) ((void *) 0)), (unsigned long) ((void *) 0)); // expected-warning {{C99 forbids conditional expressions with only one void side}} } #define nil ((void*) 0) Index: test/Sema/warn-tautological-compare.c =================================================================== --- test/Sema/warn-tautological-compare.c +++ test/Sema/warn-tautological-compare.c @@ -93,3 +93,11 @@ x = array ? 1 : 0; // expected-warning {{address of array}} x = &x ? 1 : 0; // expected-warning {{address of 'x'}} } + +void test_parentesens(short arg) { + if (0 == + (&arg)) { // expected-warning {{comparison of address of 'arg' equal to a null pointer is always false}} + } else if (0 == + &arg) { // expected-warning {{comparison of address of 'arg' equal to a null pointer is always false}} + } +}