1 // RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
5 @implementation X1 // expected-note {{implementation started here}}
6 @interface Y1 // expected-error {{missing '@end'}}
8 @end // expected-error {{'@end' must appear in an Objective-C context}}
12 @implementation X2 // expected-note {{implementation started here}}
13 @protocol Y2 // expected-error {{missing '@end'}}
15 @end // expected-error {{'@end' must appear in an Objective-C context}}
17 @interface X6 // expected-note {{class started here}}
18 @interface X7 // expected-error {{missing '@end'}}
20 @end // expected-error {{'@end' must appear in an Objective-C context}}
22 @protocol P1 // expected-note {{protocol started here}}
23 @interface P2 // expected-error {{missing '@end'}}
25 @end // expected-error {{'@end' must appear in an Objective-C context}}
27 @interface X4 // expected-note {{class started here}}
28 @implementation X4 // expected-error {{missing '@end'}}
30 @end // expected-error {{'@end' must appear in an Objective-C context}}
35 @protocol P; // forward declarations of protocols in @implementations is allowed
36 @class C; // forward declarations of classes in @implementations is allowed
41 @protocol P2; // expected-error {{illegal interface qualifier}}
42 @class C2; // expected-error {{illegal interface qualifier}}