[Bug c++/51526] New: [C++11][constexpr] constexpr delegating constructor should be accepted
daniel.kruegler at googlemail dot com
gcc-bugzilla@gcc.gnu.org
Tue Dec 13 08:48:00 GMT 2011
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.
More information about the Gcc-bugs
mailing list