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: unassig...@gcc.gnu.org
        ReportedBy: ro...@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’

Reply via email to