xref: /minix3/external/bsd/llvm/dist/clang/test/SemaObjC/ibaction.m (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1f4a2713aSLionel Sambuc// RUN: %clang_cc1 -verify -Wno-objc-root-class %s
2f4a2713aSLionel Sambuc
3f4a2713aSLionel Sambuc@interface Foo
4f4a2713aSLionel Sambuc{
5f4a2713aSLionel Sambuc  __attribute__((iboutlet)) id myoutlet;
6f4a2713aSLionel Sambuc}
7*0a6a1f1dSLionel Sambuc+ (void) __attribute__((ibaction)) myClassMethod:(id)msg; // expected-warning{{'ibaction' attribute only applies to Objective-C instance methods}}
8f4a2713aSLionel Sambuc- (void) __attribute__((ibaction)) myMessage:(id)msg;
9f4a2713aSLionel Sambuc@end
10f4a2713aSLionel Sambuc
11f4a2713aSLionel Sambuc@implementation Foo
12*0a6a1f1dSLionel Sambuc+ (void) __attribute__((ibaction)) myClassMethod:(id)msg {} // expected-warning{{'ibaction' attribute only applies to Objective-C instance methods}}
13f4a2713aSLionel Sambuc// Normally attributes should not be attached to method definitions, but
14f4a2713aSLionel Sambuc// we allow 'ibaction' to be attached because it can be expanded from
15f4a2713aSLionel Sambuc// the IBAction macro.
16f4a2713aSLionel Sambuc- (void) __attribute__((ibaction)) myMessage:(id)msg {} // no-warning
17f4a2713aSLionel Sambuc@end
18