diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2010-02-16 09:31:36 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2010-02-16 09:31:36 +0000 |
commit | fd035e6496665b1f1197868e21cb0a4594e8db6e (patch) | |
tree | 53010172e19c77ea447bcd89e117cda052ab52e0 /test/SemaCXX/access-base-class.cpp | |
parent | 2fce988e86bc01829142e4362d4eff1af0925147 (diff) | |
download | FreeBSD-src-fd035e6496665b1f1197868e21cb0a4594e8db6e.zip FreeBSD-src-fd035e6496665b1f1197868e21cb0a4594e8db6e.tar.gz |
Update clang to r96341.
Diffstat (limited to 'test/SemaCXX/access-base-class.cpp')
-rw-r--r-- | test/SemaCXX/access-base-class.cpp | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/test/SemaCXX/access-base-class.cpp b/test/SemaCXX/access-base-class.cpp index f4c58d9..d0b0fb8 100644 --- a/test/SemaCXX/access-base-class.cpp +++ b/test/SemaCXX/access-base-class.cpp @@ -2,10 +2,10 @@ namespace T1 { class A { }; -class B : private A { }; // expected-note {{'private' inheritance specifier here}} +class B : private A { }; // expected-note {{declared private here}} void f(B* b) { - A *a = b; // expected-error{{conversion from 'class T1::B' to inaccessible base class 'class T1::A'}} + A *a = b; // expected-error{{cannot cast 'class T1::B' to its private base class 'class T1::A'}} } } @@ -13,10 +13,10 @@ void f(B* b) { namespace T2 { class A { }; -class B : A { }; // expected-note {{inheritance is implicitly 'private'}} +class B : A { }; // expected-note {{implicitly declared private here}} void f(B* b) { - A *a = b; // expected-error {{conversion from 'class T2::B' to inaccessible base class 'class T2::A'}} + A *a = b; // expected-error {{cannot cast 'class T2::B' to its private base class 'class T2::A'}} } } @@ -63,13 +63,13 @@ namespace T6 { class A {}; - class B : private A { // expected-note {{'private' inheritance specifier here}} + class B : private A { // expected-note {{declared private here}} void f(C* c); }; class C : public B { void f(C *c) { - A* a = c; // expected-error {{conversion from 'class T6::C' to inaccessible base class 'class T6::A'}} + A* a = c; // expected-error {{cannot cast 'class T6::C' to its private base class 'class T6::A'}} } }; @@ -77,3 +77,14 @@ namespace T6 { A *a = c; } } + +namespace T7 { + class A {}; + class B : public A {}; + class C : private B { + void f(C *c) { + A* a = c; // okay + } + }; +} + |