52 lines · plain
1// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s2 3@interface X14@end5@implementation X1 // expected-note {{implementation started here}}6@interface Y1 // expected-error {{missing '@end'}}7@end8@end // expected-error {{'@end' must appear in an Objective-C context}}9 10@interface X211@end12@implementation X2 // expected-note {{implementation started here}}13@protocol Y2 // expected-error {{missing '@end'}}14@end15@end // expected-error {{'@end' must appear in an Objective-C context}}16 17@interface X6 // expected-note {{class started here}}18@interface X7 // expected-error {{missing '@end'}}19@end20@end // expected-error {{'@end' must appear in an Objective-C context}}21 22@protocol P1 // expected-note {{protocol started here}}23@interface P2 // expected-error {{missing '@end'}}24@end25@end // expected-error {{'@end' must appear in an Objective-C context}}26 27@interface X4 // expected-note {{class started here}}28@implementation X4 // expected-error {{missing '@end'}}29@end30@end // expected-error {{'@end' must appear in an Objective-C context}}31 32@interface I33@end34@implementation I35@protocol P; // forward declarations of protocols in @implementations is allowed36@class C; // forward declarations of classes in @implementations is allowed37- (C<P>*) MyMeth {}38@end39 40@interface I2 {} // expected-note {{class started here}}41@protocol P2; // expected-error {{missing '@end'}}42@class C2;43@end // expected-error {{'@end' must appear in an Objective-C context}}44 45@interface I346@end47@implementation I348- Meth {}49+ Cls {}50@protocol P3;51@end52