https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121641
Bug ID: 121641 Summary: Rejects valid constexpr explicitly defaulted constructor which is never a constant expression (P2448R2) Product: gcc Version: 16.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: janschultke at googlemail dot com Target Milestone: --- struct B { B(); }; struct D : B { constexpr D() = default; }; GCC rejects this code sample; Clang accepts. https://godbolt.org/z/dM84Gjvoj > <source>:4:15: error: explicitly defaulted function 'constexpr D::D()' cannot > be declared 'constexpr' because the implicit declaration is not 'constexpr': > 4 | constexpr D() = default; > | ^ > <source>:1:12: note: defaulted constructor calls non-'constexpr' 'B::B()' > 1 | struct B { B(); }; > | ^ > <source>:1:12: note: 'B::B()' declared here > Compiler returned: 1 To my understanding, P2448R2 "Relaxing some constexpr restrictions" should make this code valid because some restrictions in [dcl.constexpr] were lifted: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2448r2.html#pnum_19 The status quo for C++23 seems to be that this code is perfectly fine, except that you cannot use D() in a constant expression, but so is life.