1 // RUN: %clang_cc1 -fsyntax-only -triple x86_64-apple-macosx10.9.0 -verify -Wsentinel -std=c++11 %s
3 ptrdiff_t p0
; // expected-error{{unknown}}
4 size_t s0
; // expected-error{{unknown}}
5 void* v0
= NULL
; // expected-error{{undeclared}}
6 wint_t w0
; // expected-error{{unknown}}
7 max_align_t m0
; // expected-error{{unknown}}
9 #define __need_ptrdiff_t
13 size_t s1
; // expected-error{{unknown}}
14 void* v1
= NULL
; // expected-error{{undeclared}}
15 wint_t w1
; // expected-error{{unknown}}
16 max_align_t m1
; // expected-error{{unknown}}
23 void* v2
= NULL
; // expected-error{{undeclared}}
24 wint_t w2
; // expected-error{{unknown}}
25 max_align_t m2
; // expected-error{{unknown}}
33 wint_t w3
; // expected-error{{unknown}}
34 max_align_t m3
; // expected-error{{unknown}}
36 // Shouldn't bring in wint_t by default:
42 wint_t w4
; // expected-error{{unknown}}
55 // linux/stddef.h does something like this for cpp files:
59 // Including stddef.h again shouldn't redefine NULL
62 // gtk headers then use __attribute__((sentinel)), which doesn't work if NULL
64 void f(const char* c
, ...) __attribute__((sentinel
)); // expected-note{{function has been explicitly marked sentinel here}}
66 f("", NULL
); // expected-warning{{missing sentinel in function call}}
69 // glibc (and other) headers then define __need_NULL and rely on stddef.h
70 // to redefine NULL to the correct value again.
75 f("", NULL
); // Shouldn't warn.