warn-null.c revision f2febe6b5e9213fb4d97e1d4f9b47166be89afad
1// RUN: %clang_cc1 %s -verify -fsyntax-only
2
3// PR10837: warn if a non-pointer-typed expression is folded to a null pointer
4int *p = 0;
5int *q = '\0';  // expected-warning{{expression which evaluates to zero treated as a null pointer constant}}
6int *r = (1 - 1);  // expected-warning{{expression which evaluates to zero treated as a null pointer constant}}
7