https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77686
--- Comment #11 from Richard Biener <rguenth at gcc dot gnu.org> --- ;; Function void std::function<_Res(_ArgTypes ...)>::swap(std::function<_Res(_ArgTypes ...)>&) [with _Res = void; _ArgTypes = {}] (null) ;; enabled by -tree-original <<< Unknown tree: must_not_throw_expr <<cleanup_point <<< Unknown tree: expr_stmt std::swap<std::_Any_data> ((union _Any_data &) &((struct function *) this)->D.45189._M_functor, (union _Any_data &) &((struct function *) __x)->D.45189._M_functor) >>>>>; ^^^^ doing std::swap on _Any_data. That's of course bogus. /** * @brief Swap the targets of two %function objects. * @param __x A %function with identical call signature. * * Swap the targets of @c this function object and @a __f. This * function will not throw an %exception. */ void swap(function& __x) noexcept { std::swap(_M_functor, __x._M_functor); std::swap(_M_manager, __x._M_manager); std::swap(_M_invoker, __x._M_invoker); } and swap() seems to be used in multiple places throughout functional.