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++/35640] New: invalid access to protected base class


class A {
        };

        class B: protected A {
        };

        class C: protected A {
        public:
            C(B & b);
        };

        C::C(B & b)
        : A(b)
        {
        }

        int main() {
            B b;
            C c(b);
            return 0;
        }

should give an error for : A(b), the conversion from B to A is invalid as A is
protected.

This still fails on 4.4.0 20080317

radr://5805511


-- 
           Summary: invalid access to protected base class
           Product: gcc
           Version: 4.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mrs at apple dot com


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


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