[Bug c++/108759] New: "mandatory copy elision" not implemented during constant evaluation redux
herring at lanl dot gov
gcc-bugzilla@gcc.gnu.org
Sat Feb 11 05:49:00 GMT 2023
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108759
Bug ID: 108759
Summary: "mandatory copy elision" not implemented during
constant evaluation redux
Product: gcc
Version: 13.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: herring at lanl dot gov
Target Milestone: ---
Extending the test case in (the invalid) #94537 to have a user-provided
destructor does not cause the "mandatory copy elision" to take place even
though the implementation is no longer permitted to introduce a temporary:
struct A;
extern const A a;
struct A {
bool special=this==&a;
constexpr ~A() {}
};
constexpr A get() {return {};} // or "return A();"
constexpr A a=get();
static_assert(a.special);
More information about the Gcc-bugs
mailing list