]> granicus.if.org Git - clang/commitdiff
Check in a motivating test for the revised access semantics.
authorJohn McCall <rjmccall@apple.com>
Fri, 2 Apr 2010 00:11:49 +0000 (00:11 +0000)
committerJohn McCall <rjmccall@apple.com>
Fri, 2 Apr 2010 00:11:49 +0000 (00:11 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100159 91177308-0d34-0410-b5e6-96231b3b80d8

test/CXX/class.access/class.access.base/p5.cpp

index f84d3b27520fec9a9ba3e034ab6be9c5c757bf16..96037e7de2b04fa162fed6ffd566997c8ad9836f 100644 (file)
@@ -56,4 +56,20 @@ namespace test2 {
   };
 }
 
+namespace test3 {
+  class A {
+  protected: static int x;
+  };
+
+  class B : public A {};
+  class C : private A {
+    int test(B *b) {
+      // x is accessible at C when named in A.
+      // A is an accessible base of B at C.
+      // Therefore this succeeds.
+      return b->x;
+    }
+  };
+}
+
 // TODO: flesh out these cases