1 // RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
4 // This used to eat the @end
5 int 123 // expected-error{{expected unqualified-id}}
8 @implementation StopAtAtEnd // no-warning
9 int 123 // expected-error{{expected unqualified-id}}
13 @interface StopAtMethodDecls
14 // This used to eat the method declarations
15 int 123 // expected-error{{expected unqualified-id}}
16 - (void)foo; // expected-note{{here}}
17 int 456 // expected-error{{expected unqualified-id}}
18 + (void)bar; // expected-note{{here}}
21 @implementation StopAtMethodDecls
22 int 123 // expected-error{{expected unqualified-id}}
23 - (id)foo {} // expected-warning{{conflicting return type}}
24 int 456 // expected-error{{expected unqualified-id}}
25 + (id)bar {} // expected-warning{{conflicting return type}}
29 @interface EmbeddedNamespace
30 // This used to cause an infinite loop.
31 namespace NS { // expected-error{{expected unqualified-id}}
33 - (id)test; // expected-note{{here}}
36 @implementation EmbeddedNamespace
37 int 123 // expected-error{{expected unqualified-id}}
38 // We should still stop here and parse this namespace.
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.
52 @protocol ProtocolWithEmbeddedNamespace
53 namespace NS { // expected-error{{expected unqualified-id}}
56 - (void)PWEN_foo; // expected-note{{here}}
59 @interface ImplementPWEN <ProtocolWithEmbeddedNamespace>
62 @implementation ImplementPWEN
63 - (id)PWEN_foo {} // expected-warning{{conflicting return type}}