summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaObjCXX/nullability-consistency-arrays.mm
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2016-11-10 23:28:26 +0000
committerJordan Rose <jordan_rose@apple.com>2016-11-10 23:28:26 +0000
commitf85a9b06b826f1081f121156def4fb3ab9aa6ac3 (patch)
tree1791f774202ea5b813d6f533da66b29aea2b99c8 /clang/test/SemaObjCXX/nullability-consistency-arrays.mm
parent303e2f1eac90bf1be2eb9255411107b5ffb8a475 (diff)
downloadbcm5719-llvm-f85a9b06b826f1081f121156def4fb3ab9aa6ac3.tar.gz
bcm5719-llvm-f85a9b06b826f1081f121156def4fb3ab9aa6ac3.zip
Add -Wnullability-completeness-on-arrays.
This is an addition to (and sub-warning of) -Wnullability-completeness that warns when an array parameter is missing nullability. When the specific warning is switched off, the compiler falls back to only warning on pointer types written as pointer types. Note that use of nullability /within/ an array triggers the completeness checks regardless of whether or not the array-specific warning is enabled; the intent there is simply to determine whether a particular header is trying to be nullability-aware at all. Part of rdar://problem/25846421. llvm-svn: 286520
Diffstat (limited to 'clang/test/SemaObjCXX/nullability-consistency-arrays.mm')
-rw-r--r--clang/test/SemaObjCXX/nullability-consistency-arrays.mm12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/SemaObjCXX/nullability-consistency-arrays.mm b/clang/test/SemaObjCXX/nullability-consistency-arrays.mm
new file mode 100644
index 00000000000..8ccd191e3b8
--- /dev/null
+++ b/clang/test/SemaObjCXX/nullability-consistency-arrays.mm
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -fsyntax-only -fblocks -I %S/Inputs %s -D ARRAYS_CHECKED=1 -verify
+// RUN: %clang_cc1 -fsyntax-only -fblocks -I %S/Inputs %s -D ARRAYS_CHECKED=0 -Wno-nullability-completeness-on-arrays -verify
+// RUN: %clang_cc1 -fsyntax-only -fblocks -I %S/Inputs %s -Wno-nullability-completeness -Werror
+// RUN: %clang_cc1 -fsyntax-only -fblocks -I %S/Inputs -x objective-c %s -D ARRAYS_CHECKED=1 -verify
+// RUN: %clang_cc1 -fsyntax-only -fblocks -I %S/Inputs -x objective-c %s -D ARRAYS_CHECKED=0 -Wno-nullability-completeness-on-arrays -verify
+// RUN: %clang_cc1 -fsyntax-only -fblocks -I %S/Inputs -x objective-c %s -Wno-nullability-completeness -Werror
+
+#include "nullability-consistency-arrays.h"
+
+void h1(int *ptr) { } // don't warn
+
+void h2(int * _Nonnull p) { }
OpenPOWER on IntegriCloud