c++/2306: access control lost for virtual bases

theonetruekenny@yahoo.com theonetruekenny@yahoo.com
Fri Mar 16 11:16:00 GMT 2001


>Number:         2306
>Category:       c++
>Synopsis:       access control lost for virtual bases
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          accepts-illegal
>Submitter-Id:   net
>Arrival-Date:   Fri Mar 16 11:16:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Kenny Simpson
>Release:        gcc version 3.0 20010316 (prerelease)
>Organization:
>Environment:
online compiler
>Description:
  GCC seems to forget the access controls for virtual bases.
The current snapshot and 2.95.2 both allow the following
example.  Note that without the 'virtual' the code is
rejected as it should be.
>How-To-Repeat:
struct B { void func(){} };
struct D : private virtual B {};
struct DD : public D
{
  DD()
  : B(), // this should not be visible, but is
    D()
  {
    B::func(); // this also should not be visible, but is
  }
};
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-prs mailing list