This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/50707] New: [C++0x] Non-static const data member initializer breaks default constructor
- From: "roman at binarylife dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 12 Oct 2011 20:05:21 +0000
- Subject: [Bug c++/50707] New: [C++0x] Non-static const data member initializer breaks default constructor
- Auto-submitted: auto-generated
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â