blob: bcedf8334047a8e7bd270a80ba047907a5bc73b1 [file] [log] [blame]
Ted Kremenek422bae72010-04-18 04:59:38 +00001// RUN: %clang_cc1 %s -verify
2
3@interface Foo
4{
5 __attribute__((iboutlet)) id myoutlet;
6}
Ted Kremenek4ee2bb12011-02-04 06:54:16 +00007+ (void) __attribute__((ibaction)) myClassMethod:(id)msg; // expected-warning{{ibaction attribute can only be applied to Objective-C instance methods}}
Ted Kremenek422bae72010-04-18 04:59:38 +00008- (void) __attribute__((ibaction)) myMessage:(id)msg;
9@end
10
11@implementation Foo
Ted Kremenek4ee2bb12011-02-04 06:54:16 +000012+ (void) __attribute__((ibaction)) myClassMethod:(id)msg {} // expected-warning{{ibaction attribute can only be applied to Objective-C instance methods}}
Ted Kremenek422bae72010-04-18 04:59:38 +000013// Normally attributes should not be attached to method definitions, but
14// we allow 'ibaction' to be attached because it can be expanded from
15// the IBAction macro.
16- (void) __attribute__((ibaction)) myMessage:(id)msg {} // no-warning
17@end