summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.other/access8.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.other/access8.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/access8.C27
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.other/access8.C b/gcc/testsuite/g++.old-deja/g++.other/access8.C
new file mode 100644
index 000000000..abd401b12
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/access8.C
@@ -0,0 +1,27 @@
+// { dg-do assemble }
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 10 Feb 2000 <nathan@acm.org>
+
+// Test that access to static members from a nested class of the derived
+// type works.
+
+class Base
+{
+ protected:
+ static int Some_var;
+ typedef int Some_t;
+};
+
+class Derived : Base
+{
+ protected:
+ struct Nested
+ {
+ void Foo (Some_t);
+ void Bar (Base::Some_t) { Base::Some_var = 1; }
+ };
+};
+
+void Derived::Nested::Foo (Some_t) {
+ Some_var = 2;
+}