Make gsl::details::throw_exception not copy exception object (#667)

This fixes the build with clang 7 which introduces a new warning
`-Wreturn-std-move` which warns about needless copies when a move
operation is available (see https://reviews.llvm.org/rL329914).

We take the exception object by uref so we should throw the forwarded
version.
This commit is contained in:
Stephan Dollberg 2018-04-25 02:35:12 +01:00 committed by Anna Gringauze
parent d25969dbdf
commit 9c5e21045d

View File

@ -113,7 +113,7 @@ namespace details
template <typename Exception> template <typename Exception>
[[noreturn]] void throw_exception(Exception&& exception) [[noreturn]] void throw_exception(Exception&& exception)
{ {
throw exception; throw std::forward<Exception>(exception);
} }
#endif #endif