blob: f2b6abf73dcf69f63a4748e6f301110bd918b3be [file] [log] [blame]
Douglas Gregor261a89b2015-06-19 17:51:05 +00001// RUN: %clang_cc1 -fsyntax-only -std=c99 -Wno-nullability-declspec -pedantic %s -verify
2
3__nonnull int *ptr; // expected-warning{{type nullability specifier '__nonnull' is a Clang extension}}
4
5#pragma clang diagnostic push
6#pragma clang diagnostic ignored "-Wnullability-extension"
7__nonnull int *ptr2; // no-warning
8#pragma clang diagnostic pop
9
10#if __has_feature(nullability)
11# error Nullability should not be supported in C under -pedantic -std=c99
12#endif
13
14#if !__has_extension(nullability)
15# error Nullability should always be supported as an extension
16#endif