https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60943
--- Comment #6 from Anders Sjögren <anders at sjogren dot info> --- An alternative test case, which also tests that the correct version is selected, could be: #include <type_traits> using expected_lvalue_res_t = int; using expected_rvalue_res_t = double; struct A { auto f() & {return expected_lvalue_res_t{};} auto f() && {return expected_rvalue_res_t{};} }; void lvalue_assert() { A a; a.f(); static_assert(std::is_same<decltype(a.f()), expected_lvalue_res_t>::value,""); } void rvalue_assert() { A{}.f(); static_assert(std::is_same<decltype(A{}.f()), expected_rvalue_res_t>::value,""); }