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/CXX/class.access/class.access.base/p1.cpp | |
parent | 2fce988e86bc01829142e4362d4eff1af0925147 (diff) | |
download | FreeBSD-src-fd035e6496665b1f1197868e21cb0a4594e8db6e.zip FreeBSD-src-fd035e6496665b1f1197868e21cb0a4594e8db6e.tar.gz |
Update clang to r96341.
Diffstat (limited to 'test/CXX/class.access/class.access.base/p1.cpp')
-rw-r--r-- | test/CXX/class.access/class.access.base/p1.cpp | 45 |
1 files changed, 22 insertions, 23 deletions
diff --git a/test/CXX/class.access/class.access.base/p1.cpp b/test/CXX/class.access/class.access.base/p1.cpp index fd0d9f6..1bbcedb 100644 --- a/test/CXX/class.access/class.access.base/p1.cpp +++ b/test/CXX/class.access/class.access.base/p1.cpp @@ -54,13 +54,13 @@ namespace test0 { // of the base class are accessible as protected members of the // derived class. namespace test1 { - class Base { // expected-note 6 {{constrained by protected inheritance}} - public: int pub; static int spub; // expected-note 2 {{constrained by protected inheritance}} + class Base { + public: int pub; static int spub; protected: int prot; static int sprot; // expected-note 4 {{declared protected here}} private: int priv; static int spriv; // expected-note 8 {{declared private here}} }; - class Test : protected Base { + class Test : protected Base { // expected-note 6 {{declared protected here}} expected-note 8 {{constrained by protected inheritance here}} void test() { pub++; spub++; @@ -79,19 +79,19 @@ namespace test1 { }; void test(Test *t) { - t->pub++; // expected-error {{protected member}} + t->pub++; // expected-error {{protected member}} expected-error {{protected base class}} t->spub++; // expected-error {{protected member}} - t->prot++; // expected-error {{protected member}} + t->prot++; // expected-error {{protected member}} expected-error {{protected base class}} t->sprot++; // expected-error {{protected member}} - t->priv++; // expected-error {{private member}} + t->priv++; // expected-error {{private member}} expected-error {{protected base class}} t->spriv++; // expected-error {{private member}} // Two possible errors here: one for Base, one for the member - t->Base::pub++; // expected-error {{protected member}} + t->Base::pub++; // expected-error {{protected member}} expected-error {{protected base class}} t->Base::spub++; // expected-error {{protected member}} - t->Base::prot++; // expected-error 2 {{protected member}} + t->Base::prot++; // expected-error 2 {{protected member}} expected-error {{protected base class}} t->Base::sprot++; // expected-error 2 {{protected member}} - t->Base::priv++; // expected-error {{protected member}} expected-error {{private member}} + t->Base::priv++; // expected-error {{protected member}} expected-error {{private member}} expected-error {{protected base class}} t->Base::spriv++; // expected-error {{protected member}} expected-error {{private member}} } } @@ -102,21 +102,20 @@ namespace test1 { // the base class are accessible as private members of the derived // class. namespace test2 { - class Base { //expected-note 6 {{constrained by private inheritance}} + class Base { public: - int pub; // expected-note {{constrained by private inheritance}} - static int spub; // expected-note {{constrained by private inheritance}} + int pub; + static int spub; protected: - int prot; // expected-note {{constrained by private inheritance}} \ - // expected-note {{declared protected here}} - static int sprot; // expected-note {{constrained by private inheritance}} \ - // expected-note {{declared protected here}} + int prot; // expected-note {{declared protected here}} + static int sprot; // expected-note {{declared protected here}} private: int priv; // expected-note 4 {{declared private here}} static int spriv; // expected-note 4 {{declared private here}} }; - class Test : private Base { // expected-note 6 {{'private' inheritance specifier here}} + class Test : private Base { // expected-note 6 {{declared private here}} \ + // expected-note 10 {{constrained by private inheritance here}} void test() { pub++; spub++; @@ -135,18 +134,18 @@ namespace test2 { }; void test(Test *t) { - t->pub++; // expected-error {{private member}} expected-error {{inaccessible base class}} + t->pub++; // expected-error {{private member}} expected-error {{private base class}} t->spub++; // expected-error {{private member}} - t->prot++; // expected-error {{private member}} expected-error {{inaccessible base class}} + t->prot++; // expected-error {{private member}} expected-error {{private base class}} t->sprot++; // expected-error {{private member}} - t->priv++; // expected-error {{private member}} expected-error {{inaccessible base class}} + t->priv++; // expected-error {{private member}} expected-error {{private base class}} t->spriv++; // expected-error {{private member}} - t->Base::pub++; // expected-error {{private member}} expected-error {{inaccessible base class}} + t->Base::pub++; // expected-error {{private member}} expected-error {{private base class}} t->Base::spub++; // expected-error {{private member}} - t->Base::prot++; // expected-error {{protected member}} expected-error {{private member}} expected-error {{inaccessible base class}} + t->Base::prot++; // expected-error {{protected member}} expected-error {{private member}} expected-error {{private base class}} t->Base::sprot++; // expected-error {{protected member}} expected-error {{private member}} - t->Base::priv++; // expected-error 2 {{private member}} expected-error {{inaccessible base class}} + t->Base::priv++; // expected-error 2 {{private member}} expected-error {{private base class}} t->Base::spriv++; // expected-error 2 {{private member}} } } |