1 // RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
3 @interface MyClass1 @end
5 @protocol p1,p2,p3; // expected-note {{protocol 'p1' has no definition}} \
6 // expected-note {{protocol 'p2' has no definition}}
8 @interface MyClass1 (Category1) <p1> // expected-warning {{cannot find protocol definition for 'p1'}} expected-note {{previous definition is here}}
11 @interface MyClass1 (Category1) // expected-warning {{duplicate definition of category 'Category1' on interface 'MyClass1'}}
14 @interface MyClass1 (Category3)
17 @interface MyClass1 (Category4) @end // expected-note {{previous definition is here}}
18 @interface MyClass1 (Category5) @end
19 @interface MyClass1 (Category6) @end
20 @interface MyClass1 (Category7) @end // expected-note {{previous definition is here}}
21 @interface MyClass1 (Category8) @end // expected-note {{previous definition is here}}
24 @interface MyClass1 (Category4) @end // expected-warning {{duplicate definition of category 'Category4' on interface 'MyClass1'}}
25 @interface MyClass1 (Category7) @end // expected-warning {{duplicate definition of category 'Category7' on interface 'MyClass1'}}
26 @interface MyClass1 (Category8) @end // expected-warning {{duplicate definition of category 'Category8' on interface 'MyClass1'}}
31 @interface MyClass1 (Category) <p2, p3> @end // expected-warning {{cannot find protocol definition for 'p2'}}
33 @interface UnknownClass (Category) @end // expected-error {{cannot find interface declaration for 'UnknownClass'}}
35 @class MyClass2; // expected-note{{forward declaration of class here}}
37 @interface MyClass2 (Category) @end // expected-error {{cannot define category for undefined class 'MyClass2'}}
39 @interface XCRemoteComputerManager
42 @interface XCRemoteComputerManager()
45 @interface XCRemoteComputerManager()
48 @interface XCRemoteComputerManager(x) // expected-note {{previous definition is here}}
51 @interface XCRemoteComputerManager(x) // expected-warning {{duplicate definition of category 'x' on interface 'XCRemoteComputerManager'}}
54 @implementation XCRemoteComputerManager
57 @implementation XCRemoteComputerManager(x) // expected-note {{previous definition is here}}
60 @implementation XCRemoteComputerManager(x) // expected-error {{reimplementation of category 'x' for class 'XCRemoteComputerManager'}}
63 // <rdar://problem/7249233>
65 @protocol MultipleCat_P
66 -(void) im0; // expected-note {{method 'im0' declared here}}
69 @interface MultipleCat_I @end
71 @interface MultipleCat_I() @end
73 @interface MultipleCat_I() <MultipleCat_P> @end
75 @implementation MultipleCat_I // expected-warning {{method 'im0' in protocol 'MultipleCat_P' not implemented}}
78 // <rdar://problem/7680391> - Handle nameless categories with no name that refer
79 // to an undefined class
80 @interface RDar7680391 () @end // expected-error{{cannot find interface declaration}}
82 // <rdar://problem/8891119> - Handle @synthesize being used in conjunction
83 // with explicitly declared accessor.
84 @interface RDar8891119 {
88 @interface RDar8891119 ()
91 @interface RDar8891119 ()
92 @property (copy) id name;
94 @implementation RDar8891119
95 @synthesize name = _name;
99 @class I; // expected-note {{forward declaration}}
100 @implementation I(cat) // expected-error{{cannot find interface declaration}}
103 // <rdar://problem/11478173>
108 @interface Blah (Blarg) // expected-error{{cannot find interface declaration for 'Blah'}}