1 // PR c++/70194 2 // { dg-do compile { target c++11 } } 3 // { dg-options "-Wall" } 4 5 int i; 6 7 const bool b0 = &i == 0; // { dg-warning "the address of .i. will never be NULL" } 8 constexpr int *p = &i; 9 const bool b1 = p == 0; // { dg-warning "the address of .i. will never be NULL" } 10 const bool b2 = 0 == p; // { dg-warning "the address of .i. will never be NULL" } 11 const bool b3 = p != 0; // { dg-warning "the address of .i. will never be NULL" } 12 const bool b4 = 0 != p; // { dg-warning "the address of .i. will never be NULL" } 13