From 7bbe5f6bfc2e9c79c7c692a1cf03de56662aa14b Mon Sep 17 00:00:00 2001 From: John McCall Date: Fri, 2 Apr 2010 00:11:49 +0000 Subject: [PATCH] Check in a motivating test for the revised access semantics. 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 | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/CXX/class.access/class.access.base/p5.cpp b/test/CXX/class.access/class.access.base/p5.cpp index f84d3b2752..96037e7de2 100644 --- a/test/CXX/class.access/class.access.base/p5.cpp +++ b/test/CXX/class.access/class.access.base/p5.cpp @@ -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