// PR c++/101165 - P2266R1 - Simpler implicit move // { dg-do compile { target c++23 } } // From [diff.cpp20.expr]. template struct same_type { static const bool value = false; }; template struct same_type { static const bool value = true; }; // In C++23, returns int&&; previously returned int&. decltype(auto) f(int&& x) { return (x); } static_assert(same_type::value); // This used to work in C++20. int& g(int&& x) { return x; } // { dg-error "cannot bind non-const lvalue reference" } template decltype(auto) h(T&& x) { return (x); } static_assert(same_type::value);