mirror of
https://github.com/microsoft/GSL.git
synced 2024-11-03 17:56:43 -05:00
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:
parent
d25969dbdf
commit
9c5e21045d
@ -113,7 +113,7 @@ namespace details
|
||||
template <typename Exception>
|
||||
[[noreturn]] void throw_exception(Exception&& exception)
|
||||
{
|
||||
throw exception;
|
||||
throw std::forward<Exception>(exception);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user