summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.other/friend7.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.other/friend7.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/friend7.C21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.other/friend7.C b/gcc/testsuite/g++.old-deja/g++.other/friend7.C
new file mode 100644
index 000000000..aed56a187
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/friend7.C
@@ -0,0 +1,21 @@
+// { dg-do assemble }
+// Origin: Martin v. Löwis <loewis@informatik.hu-berlin.de>
+// Test that a friend declaration with an explicit :: finds the right fn.
+
+namespace M {
+class S;
+}
+void foo(M::S *);
+
+namespace M {
+class S {
+ friend void (::foo)(S *);
+ void Fn();
+ static S s;
+};
+}
+
+void (foo)(M::S *ptr) {
+ M::S::s.Fn();
+ ptr->Fn();
+}