YouCompleteMe/cpp/llvm/tools/clang/test/SemaObjC/ibaction.m
Strahinja Val Markovic 1f51a89d39 Adding more llvm/clang files
These were ignored by git accidentally. We want ALL OF THEM since they all came
in the llvm/clang source distribution.
2012-07-05 17:55:45 -07:00

18 lines
740 B
Objective-C

// RUN: %clang_cc1 -verify -Wno-objc-root-class %s
@interface Foo
{
__attribute__((iboutlet)) id myoutlet;
}
+ (void) __attribute__((ibaction)) myClassMethod:(id)msg; // expected-warning{{ibaction attribute can only be applied to Objective-C instance methods}}
- (void) __attribute__((ibaction)) myMessage:(id)msg;
@end
@implementation Foo
+ (void) __attribute__((ibaction)) myClassMethod:(id)msg {} // expected-warning{{ibaction attribute can only be applied to Objective-C instance methods}}
// 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