diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2015-11-04 16:09:04 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2015-11-04 16:09:04 +0000 |
commit | 4507545b0acbe55e1935daff1f5734bf781e8615 (patch) | |
tree | 5f6e964fdc542c0559a3a52fcb6c019127745cfb /test/Sema/attr-ownership.c | |
parent | 9227d8ffb2cb9e2dea1ec93e9a49c8829ffbe626 (diff) | |
download | clang-4507545b0acbe55e1935daff1f5734bf781e8615.tar.gz |
Improving the diagnostic for cases where the attribute only appertains to a function with a prototype.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@252055 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/attr-ownership.c')
-rw-r--r-- | test/Sema/attr-ownership.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/Sema/attr-ownership.c b/test/Sema/attr-ownership.c index c76f78914b..f7969d4af9 100644 --- a/test/Sema/attr-ownership.c +++ b/test/Sema/attr-ownership.c @@ -9,7 +9,7 @@ void f6(void) __attribute__((ownership_holds(foo, 1, 2, 3))); // expected-error void f7(void) __attribute__((ownership_takes(foo))); // expected-error {{'ownership_takes' attribute takes at least 2 arguments}} void f8(int *i, int *j, int k) __attribute__((ownership_holds(foo, 1, 2, 4))); // expected-error {{'ownership_holds' attribute parameter 3 is out of bounds}} -int f9 __attribute__((ownership_takes(foo, 1))); // expected-warning {{'ownership_takes' attribute only applies to functions}} +int f9 __attribute__((ownership_takes(foo, 1))); // expected-warning {{'ownership_takes' attribute only applies to non-K&R-style functions}}
void f10(int i) __attribute__((ownership_holds(foo, 1))); // expected-error {{'ownership_holds' attribute only applies to pointer arguments}} void *f11(float i) __attribute__((ownership_returns(foo, 1))); // expected-error {{'ownership_returns' attribute only applies to integer arguments}} @@ -23,3 +23,4 @@ void f15(int, int) __attribute__((ownership_returns(foo, 2))); // expected-error {{'ownership_returns' attribute index does not match; here it is 2}}
void f16(int *i, int *j) __attribute__((ownership_holds(foo, 1))) __attribute__((ownership_holds(foo, 1))); // OK, same index
void f17(void*) __attribute__((ownership_takes(__, 1)));
+void f18() __attribute__((ownership_takes(foo, 1))); // expected-warning {{'ownership_takes' attribute only applies to non-K&R-style functions}}
|