https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119964
Bug ID: 119964 Summary: GCC 15 does not delete explicitly-defaulted move constructor with (const T&&) parameter Product: gcc Version: 15.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: fchelnokov at gmail dot com Target Milestone: --- GCC 15 accepts this program: ``` struct A { int i; constexpr A(int v) : i(v) {} constexpr A(const A&&); }; constexpr int f() { A a(1); A b = static_cast<const A&&>( a ); return b.i; } constexpr A::A(const A&&) = default; static_assert( f() == 1 ); ``` unlike GCC 14 and Clang. Online demo: https://gcc.godbolt.org/z/T9xexq54n I guess the intention was to implicitly delete such constructor, and not to define it.