diff options
author | John McCall <rjmccall@apple.com> | 2010-04-02 00:11:49 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-04-02 00:11:49 +0000 |
commit | 7bbe5f6bfc2e9c79c7c692a1cf03de56662aa14b (patch) | |
tree | defab866842dce3d355db7f57b30066b28aca453 | |
parent | db73c684ba61fed4087af488e8610657ec638c17 (diff) |
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
-rw-r--r-- | test/CXX/class.access/class.access.base/p5.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
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 |