aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@gcc.gnu.org>2000-06-24 18:12:16 -0400
committerJason Merrill <jason@gcc.gnu.org>2000-06-24 18:12:16 -0400
commit5840d6e4f57a38f2c250927b4cd65c6e933f522c (patch)
tree4bb2196b541b0b668f7bb38d857cbb80ef5cf35a /gcc
parentaaa52048c2f78f0bd4568cf6f684bfaf57c243a2 (diff)
downloadgcc-5840d6e4f57a38f2c250927b4cd65c6e933f522c.zip
gcc-5840d6e4f57a38f2c250927b4cd65c6e933f522c.tar.gz
gcc-5840d6e4f57a38f2c250927b4cd65c6e933f522c.tar.bz2
new
From-SVN: r34685
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/friend6.C19
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/friend7.C21
2 files changed, 40 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.other/friend6.C b/gcc/testsuite/g++.old-deja/g++.other/friend6.C
new file mode 100644
index 0000000..1bc6119
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/friend6.C
@@ -0,0 +1,19 @@
+// Origin: Martin v. Löwis <loewis@informatik.hu-berlin.de>
+// Test for resolution of core issue 125.
+// Build don't link:
+
+struct A{
+ struct B{};
+};
+
+A::B C();
+
+namespace B{
+ A C();
+}
+
+class Test{
+ friend A (::B::C)(); // Ok
+ friend A::B (::C)(); // Ok
+ friend A::B::C(); // ERROR - no A::B::C
+};
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 0000000..02b67cc
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/friend7.C
@@ -0,0 +1,21 @@
+// Origin: Martin v. Löwis <loewis@informatik.hu-berlin.de>
+// Test that a friend declaration with an explicit :: finds the right fn.
+// Build don't link:
+
+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();
+}