gcc/testsuite/obj-c++.dg/method-namespace-1.mm
raw| 1 | /* Test for usage of namespace inside @implementation. */ |
| 2 | /* { dg-do compile } */ |
| 3 | // { dg-additional-options "-Wno-objc-root-class" } |
| 4 | @interface MyDocument |
| 5 | @end |
| 6 | |
| 7 | @implementation MyDocument |
| 8 | |
| 9 | // This deprecated usage works |
| 10 | static void foo1() { } |
| 11 | |
| 12 | // This preferred usage does _not_ work |
| 13 | namespace |
| 14 | { |
| 15 | void foo2() { } |
| 16 | } |
| 17 | |
| 18 | namespace STD |
| 19 | { |
| 20 | void foo3 () {} |
| 21 | } |
| 22 | |
| 23 | using namespace STD; |
| 24 | |
| 25 | - (void) GARF { |
| 26 | foo2(); |
| 27 | foo3(); |
| 28 | } |
| 29 | |
| 30 | @end |