aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/obj-c++.dg/method-namespace-1.mm
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/obj-c++.dg/method-namespace-1.mm')
-rw-r--r--gcc/testsuite/obj-c++.dg/method-namespace-1.mm30
1 files changed, 30 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 00000000000..c763a59c4c0
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/method-namespace-1.mm
@@ -0,0 +1,30 @@
+/* APPLE LOCAL file radar 4508851 */
+/* 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