aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.other/access3.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.other/access3.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/access3.C26
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.other/access3.C b/gcc/testsuite/g++.old-deja/g++.other/access3.C
new file mode 100644
index 00000000000..2ba2c0c51d6
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/access3.C
@@ -0,0 +1,26 @@
+// Build don't link:
+// The standard sez that a use of a name gets the most access it can through
+// the various paths that can reach it. Here, the access decl in B gives
+// us access.
+
+struct A
+{
+ void f ();
+};
+
+struct B: private virtual A
+{
+ A::f;
+};
+
+struct C: private virtual A, public B
+{
+};
+
+int
+main ()
+{
+ C c;
+
+ c.f ();
+}