summaryrefslogtreecommitdiffstats
path: root/test/CXX/class.access/class.protected/p1.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/CXX/class.access/class.protected/p1.cpp')
-rw-r--r--test/CXX/class.access/class.protected/p1.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/CXX/class.access/class.protected/p1.cpp b/test/CXX/class.access/class.protected/p1.cpp
index 132ff61..825447e 100644
--- a/test/CXX/class.access/class.protected/p1.cpp
+++ b/test/CXX/class.access/class.protected/p1.cpp
@@ -329,7 +329,7 @@ namespace test8 {
namespace test9 {
class A { // expected-note {{member is declared here}}
- protected: int foo(); // expected-note 4 {{declared}} expected-note 2 {{can only access this member on an object of type}} expected-note {{member is declared here}}
+ protected: int foo(); // expected-note 4 {{declared}} expected-note 3 {{can only access this member on an object of type}} expected-note 2 {{member is declared here}}
};
class B : public A { // expected-note {{member is declared here}}
@@ -344,14 +344,15 @@ namespace test9 {
static void test(A &a) {
a.foo(); // expected-error {{'foo' is a protected member}}
a.A::foo(); // expected-error {{'foo' is a protected member}}
- a.B::foo();
+ a.B::foo(); // expected-error {{'foo' is a protected member}}
a.C::foo(); // expected-error {{'foo' is a protected member}}
+ a.D::foo(); // expected-error {{'foo' is a protected member}}
}
static void test(B &b) {
b.foo();
b.A::foo();
- b.B::foo();
+ b.B::foo(); // accessible as named in A
b.C::foo(); // expected-error {{'foo' is a protected member}}
}
OpenPOWER on IntegriCloud