aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/obj-c++.dg/method-namespace-1.mm
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/obj-c++.dg/method-namespace-1.mm')
-rw-r--r--gcc-4.9/gcc/testsuite/obj-c++.dg/method-namespace-1.mm29
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/obj-c++.dg/method-namespace-1.mm b/gcc-4.9/gcc/testsuite/obj-c++.dg/method-namespace-1.mm
new file mode 100644
index 000000000..6095f572c
--- /dev/null
+++ b/gcc-4.9/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