https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90546
--- Comment #4 from Nick Krempel <ndkrempel at gmail dot com> --- Here's one way to turn it into a test case which fails to compile: struct Foo {}; void test(const Foo&) {} Foo f; struct Bar { template <typename T> operator T&&() = delete; }; template<> Bar::operator const Foo&&() { return static_cast<Foo&&>(f); } int main() { test(Bar{}); }