Add more test cases for 'objc_protocol_requires_explicit_implementation'.

llvm-svn: 197128
This commit is contained in:
Ted Kremenek 2013-12-12 06:20:42 +00:00
parent db05cd37a1
commit c152c528b0

View File

@ -24,6 +24,25 @@ __attribute__((objc_protocol_requires_explicit_implementation))
@implementation ClassB // expected-warning {{method 'theBestOfTimes' in protocol not implemented}}
@end
// Test that inherited protocols do not get the explicit conformance requirement.
@protocol Inherited
- (void) fairIsFoul;
@end
__attribute__((objc_protocol_requires_explicit_implementation))
@protocol Derived <Inherited>
- (void) foulIsFair; // expected-note {{method 'foulIsFair' declared here}}
@end
@interface ClassC <Inherited>
@end
@interface ClassD : ClassC <Derived> // expected-note {{required for direct or indirect protocol 'Derived'}}
@end
@implementation ClassD // expected-warning {{method 'foulIsFair' in protocol not implemented}}
@end
// Test that the attribute is used correctly.
__attribute__((objc_protocol_requires_explicit_implementation(1+2))) // expected-error {{attribute takes no arguments}}
@protocol AnotherProtocol @end