65 lines · plain
1// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s2 3@interface StopAtAtEnd4// This used to eat the @end5int 123 // expected-error{{expected unqualified-id}}6@end7 8@implementation StopAtAtEnd // no-warning9int 123 // expected-error{{expected unqualified-id}}10@end11 12 13@interface StopAtMethodDecls14// This used to eat the method declarations15int 123 // expected-error{{expected unqualified-id}}16- (void)foo; // expected-note{{here}}17int 456 // expected-error{{expected unqualified-id}}18+ (void)bar; // expected-note{{here}}19@end20 21@implementation StopAtMethodDecls22int 123 // expected-error{{expected unqualified-id}}23- (id)foo {} // expected-warning{{conflicting return type}}24int 456 // expected-error{{expected unqualified-id}}25+ (id)bar {} // expected-warning{{conflicting return type}}26@end27 28 29@interface EmbeddedNamespace30// This used to cause an infinite loop.31namespace NS { // expected-error{{expected unqualified-id}}32}33- (id)test; // expected-note{{here}}34@end35 36@implementation EmbeddedNamespace37int 123 // expected-error{{expected unqualified-id}}38// We should still stop here and parse this namespace.39namespace NS {40 void foo();41}42 43// Make sure the declaration of -test was recognized.44- (void)test { // expected-warning{{conflicting return type}}45 // Make sure the declaration of NS::foo was recognized.46 NS::foo();47}48 49@end50 51 52@protocol ProtocolWithEmbeddedNamespace53namespace NS { // expected-error{{expected unqualified-id}}54 55}56- (void)PWEN_foo; // expected-note{{here}}57@end58 59@interface ImplementPWEN <ProtocolWithEmbeddedNamespace>60@end61 62@implementation ImplementPWEN63- (id)PWEN_foo {} // expected-warning{{conflicting return type}}64@end65