https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85215
--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> --- I don't think this is just an ICE on invalid: we can trivially fix the snippet as: template <typename _Tp> struct remove_reference {}; template <typename _Tp> struct remove_reference<_Tp &> { typedef _Tp type; }; template <typename _Tp> constexpr typename remove_reference<_Tp>::type &&move(_Tp &&__t) noexcept { return static_cast<typename remove_reference<_Tp>::type&&>(__t); } template <typename _Tp> struct vector { vector(vector &&) noexcept {} }; template <typename T> struct any_container { vector<T> v; operator vector<T> &&() && { return move(v); } }; struct buffer_info { vector<int> shape; buffer_info(any_container<int> shape_in) : shape(move(shape_in)) {} };