1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
// { dg-do run { target c++1y } } int c; int d; struct A { A() { ++c; } A(const A&) { ++c; } ~A() { ++d; } }; A g() { return A(); } decltype(auto) f() { return g(); } int main() { f(); if (c < 1 || c != d) __builtin_abort (); }