diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/lib/Sema/SemaChecking.cpp @@ -14723,7 +14723,7 @@ bool IsAddressOf = false; - if (UnaryOperator *UO = dyn_cast(E)) { + if (UnaryOperator *UO = dyn_cast(E->IgnoreParenCasts())) { if (UO->getOpcode() != UO_AddrOf) return; IsAddressOf = true; diff --git a/clang/test/Sema/conditional-expr.c b/clang/test/Sema/conditional-expr.c --- a/clang/test/Sema/conditional-expr.c +++ b/clang/test/Sema/conditional-expr.c @@ -86,7 +86,7 @@ int Postgresql(void) { 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}} + return ((((&x) != ((void *) 0)) ? (*(&x) = ((char) 1)) : (void) ((void *) 0)), (unsigned long) ((void *) 0)); // expected-warning {{comparison of address of 'x' not equal to a null pointer is always true}} } #define nil ((void*) 0) diff --git a/clang/test/SemaCXX/constant-expression-cxx2a.cpp b/clang/test/SemaCXX/constant-expression-cxx2a.cpp --- a/clang/test/SemaCXX/constant-expression-cxx2a.cpp +++ b/clang/test/SemaCXX/constant-expression-cxx2a.cpp @@ -249,7 +249,7 @@ // During construction of C, A is unambiguous subobject of dynamic type C. static_assert(g.c == (C*)&g); // ... but in the complete object, the same is not true, so the runtime fails. - static_assert(dynamic_cast(static_cast(&g)) == nullptr); + static_assert(dynamic_cast(static_cast(&g)) == nullptr); // expected-warning {{comparison of address of 'g' equal to a null pointer is always false}} // dynamic_cast produces a pointer to the object of the dynamic type. static_assert(g.f == (void*)(F*)&g);