summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2016-12-19 20:58:20 +0000
committerJordan Rose <jordan_rose@apple.com>2016-12-19 20:58:20 +0000
commit84ab5b60de850ca615d6223720626f3cd56c3f72 (patch)
treefcacfcc125bb74f51e9998a560bd1f35406c5b1a /include
parent01fa6f3b298b98d5f3ecccad52223326c30a280b (diff)
Add fix-it notes to the nullability consistency warning.
This is especially important for arrays, since no one knows the proper syntax for putting qualifiers in arrays. nullability.h:3:26: warning: array parameter is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) void arrayParameter(int x[]); ^ nullability.h:3:26: note: insert '_Nullable' if the array parameter may be null void arrayParameter(int x[]); ^ _Nullable nullability.h:3:26: note: insert '_Nonnull' if the array parameter should never be null void arrayParameter(int x[]); ^ _Nonnull rdar://problem/29524992 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290132 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/clang/Basic/DiagnosticSemaKinds.td4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td
index 73f7f4ddd6..2e64f10a5e 100644
--- a/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/include/clang/Basic/DiagnosticSemaKinds.td
@@ -8770,6 +8770,10 @@ def warn_nullability_missing_array : Warning<
"array parameter is missing a nullability type specifier (_Nonnull, "
"_Nullable, or _Null_unspecified)">,
InGroup<NullabilityCompletenessOnArrays>;
+def note_nullability_fix_it : Note<
+ "insert '%select{_Nonnull|_Nullable|_Null_unspecified}0' if the "
+ "%select{pointer|block pointer|member pointer|array parameter}1 "
+ "%select{should never be null|may be null|should not declare nullability}0">;
def warn_nullability_inferred_on_nested_type : Warning<
"inferring '_Nonnull' for pointer type within %select{array|reference}0 is "