https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87431
--- Comment #13 from Antony Polukhin <antoshkka at gmail dot com> --- Yeah... but some whitelist of types to move could be hardcoded. For example std::basic_string, std::vector, std::unique_ptr and std::shared_ptr could be safely moved and `valueless_by_exception()` never happen for them. Those types cover some of the popular std::variant usages and the overhead from `valueless_by_exception()` will be avoided for those cases.