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++/51526] New: [C++11][constexpr] constexpr delegating constructor should be accepted


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.


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