summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/access-base-class.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-03-18 23:49:19 +0000
committerJohn McCall <rjmccall@apple.com>2010-03-18 23:49:19 +0000
commita332b953e84ac0151789272b3bd0c56bf615a58c (patch)
treece71c230642088a197865ce11d435c08902ad5fe /clang/test/SemaCXX/access-base-class.cpp
parentc6b5a3df1e73552d86808f7dccc043386e30b235 (diff)
downloadbcm5719-llvm-a332b953e84ac0151789272b3bd0c56bf615a58c.tar.gz
bcm5719-llvm-a332b953e84ac0151789272b3bd0c56bf615a58c.zip
When elevating access along an inheritance path, initialize the computed
access to the (elevated) access of the accessed declaration, if applicable, rather than plunking that access onto the end after we've calculated the inheritance access. Also, being a friend of a derived class gives you public access to its members (subject to later modification by further inheritance); it does not simply ignore a single location of restricted inheritance. Also, when computing the best unprivileged path to a subobject, preserve the information that the worst path might be AS_none (forbidden) rather than a minimum of AS_private. llvm-svn: 98899
Diffstat (limited to 'clang/test/SemaCXX/access-base-class.cpp')
-rw-r--r--clang/test/SemaCXX/access-base-class.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/test/SemaCXX/access-base-class.cpp b/clang/test/SemaCXX/access-base-class.cpp
index eeb5f1c86fc..25fd9e52aa2 100644
--- a/clang/test/SemaCXX/access-base-class.cpp
+++ b/clang/test/SemaCXX/access-base-class.cpp
@@ -63,13 +63,14 @@ namespace T6 {
class A {};
- class B : private A { // expected-note {{declared private here}}
+ class B : private A { // expected-note {{declared private here}} expected-note {{constrained by private inheritance here}}
void f(C* c);
};
class C : public B {
void f(C *c) {
- A* a = c; // expected-error {{cannot cast 'T6::C' to its private base class 'T6::A'}}
+ A* a = c; // expected-error {{cannot cast 'T6::C' to its private base class 'T6::A'}} \
+ // expected-error {{'A' is a private member of 'T6::A'}}
}
};
OpenPOWER on IntegriCloud