diff options
Diffstat (limited to 'gcc/testsuite/obj-c++.dg/method-namespace-1.mm')
-rw-r--r-- | gcc/testsuite/obj-c++.dg/method-namespace-1.mm | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc/testsuite/obj-c++.dg/method-namespace-1.mm b/gcc/testsuite/obj-c++.dg/method-namespace-1.mm new file mode 100644 index 000000000..6095f572c --- /dev/null +++ b/gcc/testsuite/obj-c++.dg/method-namespace-1.mm @@ -0,0 +1,29 @@ +/* Test for usage of namespace inside @implementation. */ +/* { dg-do compile } */ +@interface MyDocument +@end + +@implementation MyDocument + +// This deprecated usage works +static void foo1() { } + +// This preferred usage does _not_ work +namespace + { + void foo2() { } + } + +namespace STD + { + void foo3 () {} + } + +using namespace STD; + +- (void) GARF { + foo2(); + foo3(); +} + +@end |