diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-09-01 19:57:52 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-09-01 19:57:52 +0000 |
commit | c4f6d90ba1973853295737b5ba179ee8ae4db37a (patch) | |
tree | 4c64ee5348675a294e9b26292b3ca77e8c2c603a /clang/test/Sema/nonnull.c | |
parent | 2c5208c59fcdae2e47fe8f98e6506bb098ea2005 (diff) | |
download | bcm5719-llvm-c4f6d90ba1973853295737b5ba179ee8ae4db37a.tar.gz bcm5719-llvm-c4f6d90ba1973853295737b5ba179ee8ae4db37a.zip |
Tidy up sema processing of attribute "nonull":
- warn about nonnull being applied to functions with no pointer arguments
- continue processing argument list in the attribute when we encounter a non-pointer parameter being marked as nonnull
- when no argument list is specified, only mark pointers as nonnull. This fixes PR 2732 and radar 6188814.
llvm-svn: 55610
Diffstat (limited to 'clang/test/Sema/nonnull.c')
-rw-r--r-- | clang/test/Sema/nonnull.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/test/Sema/nonnull.c b/clang/test/Sema/nonnull.c index f8a2a0ed788..9a64ce4320b 100644 --- a/clang/test/Sema/nonnull.c +++ b/clang/test/Sema/nonnull.c @@ -1,6 +1,6 @@ // RUN: clang -fsyntax-only -verify %s -int f1(int x) __attribute__((nonnull)); +int f1(int x) __attribute__((nonnull)); // expected-warning{{'nonnull' attribute applied to function with no pointer arguments}} 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))); |