1 // RUN: %clang_cc1 %s -verify 2 3 #define SOME_ADDR (unsigned long long)0 4 5 // PR10837: Warn if a non-pointer-typed expression is folded to a null pointer 6 int *p = 0; 7 int *q = '\0'; // expected-warning{{expression which evaluates to zero treated as a null pointer constant}} 8 int *r = (1 - 1); // expected-warning{{expression which evaluates to zero treated as a null pointer constant}} 9 void f() { 10 p = 0; 11 q = '\0'; // expected-warning{{expression which evaluates to zero treated as a null pointer constant}} 12 r = 1 - 1; // expected-warning{{expression which evaluates to zero treated as a null pointer constant}} 13 p = SOME_ADDR; // expected-warning{{expression which evaluates to zero treated as a null pointer constant}} 14 } 15