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++/50707] New: [C++0x] Non-static const data member initializer breaks default constructor


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

             Bug #: 50707
           Summary: [C++0x] Non-static const data member initializer
                    breaks default constructor
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: roman@binarylife.net


$ cat test.cpp 
int g;

struct S {
   int const v=g;
};

S s;

$ g++ -std=c++0x -c ./test.cpp 
./test.cpp:7:3: error: use of deleted function âS::S()â
./test.cpp:3:8: error: âS::S()â is implicitly deleted because the default
definition would be ill-formed:
./test.cpp:3:8: error: uninitialized non-static const member âconst int S::vâ


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