2012-04-07 02:12:22 +08:00
|
|
|
// RUN: %clang_cc1 -verify -Wno-objc-root-class %s
|
2010-04-18 12:59:38 +08:00
|
|
|
|
|
|
|
@interface Foo
|
|
|
|
{
|
|
|
|
__attribute__((iboutlet)) id myoutlet;
|
|
|
|
}
|
2011-02-04 14:54:16 +08:00
|
|
|
+ (void) __attribute__((ibaction)) myClassMethod:(id)msg; // expected-warning{{ibaction attribute can only be applied to Objective-C instance methods}}
|
2010-04-18 12:59:38 +08:00
|
|
|
- (void) __attribute__((ibaction)) myMessage:(id)msg;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation Foo
|
2011-02-04 14:54:16 +08:00
|
|
|
+ (void) __attribute__((ibaction)) myClassMethod:(id)msg {} // expected-warning{{ibaction attribute can only be applied to Objective-C instance methods}}
|
2010-04-18 12:59:38 +08:00
|
|
|
// Normally attributes should not be attached to method definitions, but
|
|
|
|
// we allow 'ibaction' to be attached because it can be expanded from
|
|
|
|
// the IBAction macro.
|
|
|
|
- (void) __attribute__((ibaction)) myMessage:(id)msg {} // no-warning
|
|
|
|
@end
|