This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/51526] New: [C++11][constexpr] constexpr delegating constructor should be accepted
- From: "daniel.kruegler at googlemail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 13 Dec 2011 08:41:44 +0000
- Subject: [Bug c++/51526] New: [C++11][constexpr] constexpr delegating constructor should be accepted
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51526
Bug #: 51526
Summary: [C++11][constexpr] constexpr delegating constructor
should be accepted
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: daniel.kruegler@googlemail.com
CC: jason@gcc.gnu.org
gcc 4.7.0 20111210 (experimental) rejects the following program by producing an
ICE:
//--------
struct S {
int i;
constexpr S(int i) : i(i) {}
constexpr S() : S(42) {}
};
constexpr S s{};
//--------
"
main.cpp||In constructor 'constexpr S::S()':|
main.cpp|4|internal compiler error: in build_data_member_initialization, at
cp/semantics.c:5777
"
The code should be accepted, it seems that S::S() satisfies the criteria for a
constexpr constructor as of 7.1.5.