diff options
| author | Fariborz Jahanian <fjahanian@apple.com> | 2009-05-12 21:36:23 +0000 |
|---|---|---|
| committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-05-12 21:36:23 +0000 |
| commit | 2bd617c46c6e8a8940214bd0afe64a52b4fc59e8 (patch) | |
| tree | 28257bfb5047fb33e6f4394731f18f038559d1b3 /clang/test | |
| parent | 2399628cea7b5e1aa9836a9077ce00ee2f76187a (diff) | |
| download | bcm5719-llvm-2bd617c46c6e8a8940214bd0afe64a52b4fc59e8.tar.gz bcm5719-llvm-2bd617c46c6e8a8940214bd0afe64a52b4fc59e8.zip | |
Method attributes may only be specified on method
declarations.
llvm-svn: 71597
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/SemaObjC/attr-deprecated.m | 2 | ||||
| -rw-r--r-- | clang/test/SemaObjC/method-attributes.m | 22 |
2 files changed, 23 insertions, 1 deletions
diff --git a/clang/test/SemaObjC/attr-deprecated.m b/clang/test/SemaObjC/attr-deprecated.m index 52f654ab5d7..3741510e113 100644 --- a/clang/test/SemaObjC/attr-deprecated.m +++ b/clang/test/SemaObjC/attr-deprecated.m @@ -9,7 +9,7 @@ @implementation A + (void)F __attribute__((deprecated)) -{ +{ // expected-warning {{method attribute may be specified on method declarations only}} [self F]; // no warning, since the caller is also deprecated. } diff --git a/clang/test/SemaObjC/method-attributes.m b/clang/test/SemaObjC/method-attributes.m index 003cea4bd70..354950c49c7 100644 --- a/clang/test/SemaObjC/method-attributes.m +++ b/clang/test/SemaObjC/method-attributes.m @@ -8,3 +8,25 @@ -(void) m0 __attribute__((noreturn)); -(void) m1 __attribute__((unused)); @end + + +@interface INTF +- (int) foo1: (int)arg1 __attribute__((deprecated)); + +- (int) foo: (int)arg1; + +- (int) foo2: (int)arg1 __attribute__((deprecated)) __attribute__((unavailable)); +@end + +@implementation INTF +- (int) foo: (int)arg1 __attribute__((deprecated)){ // expected-warning {{method attribute may be specified}} + return 10; +} +- (int) foo1: (int)arg1 { + return 10; +} +- (int) foo2: (int)arg1 __attribute__((deprecated)) { // expected-warning {{method attribute may be specified}} + return 10; +} +@end + |

