http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58993

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Chris Studholme from comment #0)
> Sample code:
> 
> class base {
> protected:
>     typedef void (base::*foo_type)() const;
>     void foo() const {}
> };
> 
> template <typename T>
> struct bar : public base {
>     foo_type test() { 
>         return &base::foo;       // OK

The bug is here, this should be an error too (but G++ has lots of bugs with
access checking in templates)

The name foo is a protected member of base, to access it you have to do it via
the derived class, i.e. you should do:

        return &bar::foo;

Reply via email to