[Bug c++/11174] derived class can access protected base class member function through pointer to member function
giovannibajo@libero.it
gcc-bugzilla@gcc.gnu.org
Thu Jun 12 15:36:00 GMT 2003
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11174
giovannibajo@libero.it changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2003-06-12 15:36:40
date| |
------- Additional Comments From giovannibajo@libero.it 2003-06-12 15:36 -------
Confirmed. Reduced snippet:
---------------------------------
struct A
{
protected:
int a;
};
struct B : A
{
void foo()
{
(void)&A::a;
}
};
---------------------------------
This is accepted by any version of GCC but it is ill-formed (see the example in
§11.5).
More information about the Gcc-bugs
mailing list