1 // RUN: %clang_cc1 %s -verify
3 #define SOME_ADDR (unsigned long long)0
5 // PR10837: Warn if a non-pointer-typed expression is folded to a null pointer
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}}
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}}