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++/55120] New: Inaccessible virtual base constructor does not prevent generation of default constructor


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

             Bug #: 55120
           Summary: Inaccessible virtual base constructor does not prevent
                    generation of default constructor
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: ndkrempel@gmail.com


The following code should fail to compile but does not:

struct V {};
struct B : private virtual V {};
struct D : B {};

int main() {
    D d;
}

According to N3376 section 12.1 paragraph 5, the defaulted default constructor
for D should be defined as deleted, as the default constructor for the virtual
base V is inaccessible from D.


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