1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s 2*f4a2713aSLionel Sambuc 3*f4a2713aSLionel Sambucnamespace C { 4*f4a2713aSLionel Sambuc 5*f4a2713aSLionel Sambuc@protocol P; //expected-error{{Objective-C declarations may only appear in global scope}} 6*f4a2713aSLionel Sambuc 7*f4a2713aSLionel Sambuc@class Bar; //expected-error{{Objective-C declarations may only appear in global scope}} 8*f4a2713aSLionel Sambuc 9*f4a2713aSLionel Sambuc@compatibility_alias Foo Bar; //expected-error{{Objective-C declarations may only appear in global scope}} 10*f4a2713aSLionel Sambuc 11*f4a2713aSLionel Sambuc@interface A //expected-error{{Objective-C declarations may only appear in global scope}} 12*f4a2713aSLionel Sambuc@end 13*f4a2713aSLionel Sambuc 14*f4a2713aSLionel Sambuc@implementation A //expected-error{{Objective-C declarations may only appear in global scope}} 15*f4a2713aSLionel Sambuc@end 16*f4a2713aSLionel Sambuc 17*f4a2713aSLionel Sambuc@protocol P //expected-error{{Objective-C declarations may only appear in global scope}} 18*f4a2713aSLionel Sambuc@end 19*f4a2713aSLionel Sambuc 20*f4a2713aSLionel Sambuc@interface A(C) //expected-error{{Objective-C declarations may only appear in global scope}} 21*f4a2713aSLionel Sambuc@end 22*f4a2713aSLionel Sambuc 23*f4a2713aSLionel Sambuc@implementation A(C) //expected-error{{Objective-C declarations may only appear in global scope}} 24*f4a2713aSLionel Sambuc@end 25*f4a2713aSLionel Sambuc 26*f4a2713aSLionel Sambuc@interface B @end //expected-error{{Objective-C declarations may only appear in global scope}} 27*f4a2713aSLionel Sambuc@implementation B //expected-error{{Objective-C declarations may only appear in global scope}} 28*f4a2713aSLionel Sambuc+ (void) foo {} 29*f4a2713aSLionel Sambuc@end 30*f4a2713aSLionel Sambuc 31*f4a2713aSLionel Sambuc} 32*f4a2713aSLionel Sambuc 33