1 // PR c++/101165 - P2266R1 - Simpler implicit move
2 // { dg-do compile { target c++14 } }
3 // A variant of cxx23/elision1.C:eight, just with ().
14 decltype(auto) x = val(); // OK, x is Widget
15 // We deduce the return type to int&&, therefore we're doing something
16 // we ought not to be doing -- returning a reference to a local variable!
17 // In C++20, we deduce to int&, but that has the same problem!
18 return (x); // { dg-warning "reference to local variable" }