]> granicus.if.org Git - clang/commitdiff
Add more test cases for 'objc_protocol_requires_explicit_implementation'.
authorTed Kremenek <kremenek@apple.com>
Thu, 12 Dec 2013 06:20:42 +0000 (06:20 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 12 Dec 2013 06:20:42 +0000 (06:20 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197128 91177308-0d34-0410-b5e6-96231b3b80d8

test/SemaObjC/protocols-suppress-conformance.m

index 3d6537015c8eed791bbf5e15fc8ec5d431175e9c..3349f7f90a433aef1605aefa525b126b7f565fd3 100644 (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