[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Parser / nullability.c
blobd70087df9f1fccd26dd2222f0d653181663b8ee5
1 // RUN: %clang_cc1 -fsyntax-only -std=c99 -Wno-nullability-declspec -pedantic %s -verify
3 _Nonnull int *ptr; // expected-warning{{type nullability specifier '_Nonnull' is a Clang extension}}
5 #pragma clang diagnostic push
6 #pragma clang diagnostic ignored "-Wnullability-extension"
7 _Nonnull int *ptr2; // no-warning
8 #pragma clang diagnostic pop
10 #if !__has_feature(nullability)
11 # error Nullability should always be supported
12 #endif
14 #if !__has_feature(nullability_on_arrays)
15 # error Nullability on array parameters should always be supported
16 #endif
18 #if !__has_extension(nullability)
19 # error Nullability should always be supported as an extension
20 #endif
22 #if !__has_extension(nullability_on_arrays)
23 # error Nullability on array parameters should always be supported as an extension
24 #endif