diff options
| author | Aaron Ballman <aaron@aaronballman.com> | 2014-07-11 16:31:29 +0000 |
|---|---|---|
| committer | Aaron Ballman <aaron@aaronballman.com> | 2014-07-11 16:31:29 +0000 |
| commit | 6288d0648ae504183c270b664126c88bb9f51f38 (patch) | |
| tree | ca99c22e0dc584aaaba6c2c275501f695ce1fe45 /clang/test/Sema/nonnull.c | |
| parent | 923121e85b9a52bfc33faa3b8aec1f8d26e25af5 (diff) | |
| download | bcm5719-llvm-6288d0648ae504183c270b664126c88bb9f51f38.tar.gz bcm5719-llvm-6288d0648ae504183c270b664126c88bb9f51f38.zip | |
The returns_nonnull attribute does not require a function prototype because it affects only the return value, not any arguments. In turn, asking for a function or method result type should not require a function prototype either, so getFunctionOrMethodResultType has been relaxed.
llvm-svn: 212827
Diffstat (limited to 'clang/test/Sema/nonnull.c')
| -rw-r--r-- | clang/test/Sema/nonnull.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/test/Sema/nonnull.c b/clang/test/Sema/nonnull.c index 0e92654c283..b1f69208241 100644 --- a/clang/test/Sema/nonnull.c +++ b/clang/test/Sema/nonnull.c @@ -38,7 +38,8 @@ void *test_ptr_returns_nonnull(void) __attribute__((returns_nonnull)); // no-war int i __attribute__((nonnull)); // expected-warning {{'nonnull' attribute only applies to functions, methods, and parameters}} int j __attribute__((returns_nonnull)); // expected-warning {{'returns_nonnull' attribute only applies to functions and methods}} -void *test_no_fn_proto() __attribute__((returns_nonnull)); // expected-warning {{'returns_nonnull' attribute only applies to functions and methods}} +void *test_no_fn_proto() __attribute__((returns_nonnull)); // no-warning +void *test_with_fn_proto(void) __attribute__((returns_nonnull)); // no-warning __attribute__((returns_nonnull)) void *test_bad_returns_null(void) { |

