Created on 1999-07-16.00:00:00 last changed 274 months ago
Proposed resolution (10/00):
Replace the example in 11.8.3 [class.access.base] paragraph 3 with:
class B {
public:
int mi; // nonstatic member
static int si; // static member
};
class D: private B {
};
class DD: public D {
void f();
};
void DD::f() {
mi = 3; // error: mi is private in D
si = 3; // error: si is private in D
::B b;
b.mi = 3; // OK (b.mi is different from this->mi)
b.si = 3; // OK (b.si is different from this->si)
::B::si = 3; // OK
::B* bp1 = this; // error: B is a private base class
::B* bp2 = (::B*)this; // OK with cast
bp2->mi = 3; // OK: access through a pointer to B
}
In the example in paragraph 3 of 11.8.3 [class.access.base] , all the references to B in DD::f() should be replaced by ::B. The reason is that the class name B is private in D and thus inaccessible in DD. (The example was probably not updated when class name injection was added.)
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2003-04-25 00:00:00 | admin | set | status: dr -> tc1 |
| 2000-11-18 00:00:00 | admin | set | status: ready -> dr |
| 2000-05-21 00:00:00 | admin | set | status: drafting -> ready |
| 2000-02-23 00:00:00 | admin | set | messages: + msg227 |
| 2000-02-23 00:00:00 | admin | set | status: open -> drafting |
| 1999-07-16 00:00:00 | admin | create | |