Daniel Dunbar | d7d5f02 | 2009-03-24 02:24:46 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -fsyntax-only -verify %s |
Anders Carlsson | 1528145 | 2008-11-04 16:57:32 +0000 | [diff] [blame] | 2 | |
| 3 | namespace C { |
| 4 | |
| 5 | @protocol P; //expected-error{{Objective-C declarations may only appear in global scope}} |
| 6 | |
| 7 | @class Bar; //expected-error{{Objective-C declarations may only appear in global scope}} |
| 8 | |
| 9 | @compatibility_alias Foo Bar; //expected-error{{Objective-C declarations may only appear in global scope}} |
| 10 | |
| 11 | @interface A //expected-error{{Objective-C declarations may only appear in global scope}} |
| 12 | @end |
| 13 | |
| 14 | @implementation A //expected-error{{Objective-C declarations may only appear in global scope}} |
| 15 | @end |
| 16 | |
| 17 | @protocol P //expected-error{{Objective-C declarations may only appear in global scope}} |
| 18 | @end |
| 19 | |
| 20 | @interface A(C) //expected-error{{Objective-C declarations may only appear in global scope}} |
| 21 | @end |
| 22 | |
| 23 | @implementation A(C) //expected-error{{Objective-C declarations may only appear in global scope}} |
| 24 | @end |
| 25 | |
| 26 | } |
| 27 | |