diff options
author | Ted Kremenek <kremenek@apple.com> | 2010-09-09 01:17:32 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2010-09-09 01:17:32 +0000 |
commit | 0f107e4386380e45ea61a16621e149e5d2e1e4c7 (patch) | |
tree | 85a0b0ab28977d6937c8280e66799400803f8a08 /clang/test/SemaObjC | |
parent | 2ff757d4226205703ee24f63cbc6fae8a5f3a391 (diff) | |
download | bcm5719-llvm-0f107e4386380e45ea61a16621e149e5d2e1e4c7.tar.gz bcm5719-llvm-0f107e4386380e45ea61a16621e149e5d2e1e4c7.zip |
Relax __attribute_((nonnull)) checking to allow the attribute on functions with no pointer arguments. GCC doesn't warn
in this case, and the attribute is trivially satisfied (and benign). Fixes <rdar://problem/8364828>.
llvm-svn: 113464
Diffstat (limited to 'clang/test/SemaObjC')
-rw-r--r-- | clang/test/SemaObjC/nonnull.m | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/test/SemaObjC/nonnull.m b/clang/test/SemaObjC/nonnull.m index 15fee74a3b5..282fd21a140 100644 --- a/clang/test/SemaObjC/nonnull.m +++ b/clang/test/SemaObjC/nonnull.m @@ -2,7 +2,7 @@ @class NSObject; -int f1(int x) __attribute__((nonnull)); // expected-warning{{'nonnull' attribute applied to function with no pointer arguments}} +int f1(int x) __attribute__((nonnull)); //no-warning int f2(int *x) __attribute__ ((nonnull (1))); int f3(int *x) __attribute__ ((nonnull (0))); // expected-error {{'nonnull' attribute parameter 1 is out of bounds}} int f4(int *x, int *y) __attribute__ ((nonnull (1,2))); @@ -44,4 +44,4 @@ foo (int i1, int i2, int i3, void (^cp1)(), void (^cp2)(), void (^cp3)()) func7((NSObject*) 0); // no-warning } -void func5(int) __attribute__((nonnull)); // expected-warning{{'nonnull' attribute applied to function with no pointer arguments}} +void func5(int) __attribute__((nonnull)); // no-warning |