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++/58126] New: No diagnostic when inheriting an uninitialized const or reference member


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

            Bug ID: 58126
           Summary: No diagnostic when inheriting an uninitialized const
                    or reference member
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vvnic.holas at gmail dot com

The following code compiles without any warning or error:

struct A {
    const int value1;
    int& value2;
};

struct B : A {};

int main() {
    B b; // no error
//    A a; // error, as expected
}


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