blob: c092f24828474c3303002347a5d8bcfc67a5dcbd [file] [log] [blame]
Patrick Beardb2f68202012-04-06 18:12:22 +00001// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
Chris Lattnercddc8882009-03-01 00:56:52 +00002
Fariborz Jahanian8822f7c2010-03-27 19:02:17 +00003@interface MyClass // expected-note {{required for direct or indirect protocol 'P'}}
Chris Lattnercddc8882009-03-01 00:56:52 +00004@end
5
6@protocol P
7- (void)Pmeth;
Ted Kremenek3306ec12012-02-27 22:55:11 +00008- (void)Pmeth1; // expected-note {{method 'Pmeth1' declared here}}
Chris Lattnercddc8882009-03-01 00:56:52 +00009@end
10
11// Class extension
12@interface MyClass () <P>
Fariborz Jahanian8822f7c2010-03-27 19:02:17 +000013- (void)meth2; // expected-note {{method definition for 'meth2' not found}}
Chris Lattnercddc8882009-03-01 00:56:52 +000014@end
15
16// Add a category to test that clang does not emit warning for this method.
17@interface MyClass (Category)
18- (void)categoryMethod;
19@end
20
Fariborz Jahanian61c8d3e2010-10-29 23:20:05 +000021@implementation MyClass // expected-warning {{incomplete implementation}} \
Ted Kremenek3306ec12012-02-27 22:55:11 +000022 // expected-warning {{method 'Pmeth1' in protocol not implemented}}
Chris Lattnercddc8882009-03-01 00:56:52 +000023- (void)Pmeth {}
24@end