This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/11174] derived class can access protected base class member function through pointer to member function


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).


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]