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++/67395] New: It is possible to override c++ access control in case of indirect inheritance


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67395

            Bug ID: 67395
           Summary: It is possible to override c++ access control in case
                    of indirect inheritance
           Product: gcc
           Version: 5.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: webczat_200 at poczta dot onet.pl
  Target Milestone: ---

Created attachment 36269
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36269&action=edit
test case

It seems that g++ does have an access control bug.
In case of multiple inheritance, where one base class appears multiple times in
a hierarchy, once inherited as a private, once as a public member, it is
possible to override this.
That is quite difficult to explain, I am attaching a test case that g++ does
compile, clang fails on that. I didn't check the standard itself, so it is
possible that it is not a bug, but for me it seems unlikely.


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