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++/20397] improve diagnostic for 'is inaccessible' error



------- Comment #13 from s dot franke at bebbosoft dot de  2010-03-05 17:52 -------
(in reply to comment #12)

Yes I am referring to the standard.

C++ std 1998:

    class A { };
    class B: private A { };
    class C: public B {
        A* p;    // ok: A accessible
    };

recent changes (someone went insane???):

    class A { };
    class B: private A { };
    class C: public B {
        A* p;    // error: A inaccessible
    };


but this compiles

    class _A { int x; };
    typedef _A A;
    class B: private A { };
    class C: public B {
        A* p; 
    };

also this

    #include <vector>
    typedef std::vector<char> A;
    class B: private A { };
    class C: public B {
        A* p; 
    };

and also this

    #include <vector>
    using namespace std;
    class B: private vector<char> { };
    class C: public B {
        vector<char>* p;    // ok: A accessible
    };

very wierd and unlucky.


-- 


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


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