Demand for copy constructor definition when mandatory copy elision must take place #53245
Closed as not planned
Closed as not planned
Description
In next code copy constructor shall not be called and checked because of mandatory copy elision:
struct A {
consteval A() {}
consteval A(const A&);
consteval void f() {}
};
int main() {
A{A{}}.f();
}
GCC and MSVC accept the code. But Clang does not:
undefined constructor 'A' cannot be used in a constant expression
Metadata
Assignees
Type
Projects
Status
Done
Activity