[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / Parser / objc-recover.mm
blob61444c7178d098ee42c70c2b4aeff690946f892a
1 // RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
3 @interface StopAtAtEnd
4 // This used to eat the @end
5 int 123 // expected-error{{expected unqualified-id}}
6 @end
8 @implementation StopAtAtEnd // no-warning
9 int 123 // expected-error{{expected unqualified-id}}
10 @end
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}}
19 @end
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}}
26 @end
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}}
34 @end
36 @implementation EmbeddedNamespace
37 int 123 // expected-error{{expected unqualified-id}}
38 // We should still stop here and parse this namespace.
39 namespace NS {
40   void foo();
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();
49 @end
52 @protocol ProtocolWithEmbeddedNamespace
53 namespace NS { // expected-error{{expected unqualified-id}}
56 - (void)PWEN_foo; // expected-note{{here}}
57 @end
59 @interface ImplementPWEN <ProtocolWithEmbeddedNamespace>
60 @end
62 @implementation ImplementPWEN
63 - (id)PWEN_foo {} // expected-warning{{conflicting return type}}
64 @end