diff options
author | Stephan Dollberg <stephan.dollberg@gmail.com> | 2018-04-25 02:35:12 +0100 |
---|---|---|
committer | Anna Gringauze <annagrin@microsoft.com> | 2018-04-24 18:35:12 -0700 |
commit | 9c5e21045dd1138750868ed307110778ef4f4bc3 (patch) | |
tree | 10f4182902c01ee6d28511e19c015dac973f8e3a | |
parent | d25969dbdfc3fe144baf60165d0850861afef45c (diff) | |
download | Microsoft-GSL-9c5e21045dd1138750868ed307110778ef4f4bc3.tar.gz |
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.
-rw-r--r-- | include/gsl/gsl_assert | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/gsl/gsl_assert b/include/gsl/gsl_assert index 2bda149..3f5746a 100644 --- a/include/gsl/gsl_assert +++ b/include/gsl/gsl_assert @@ -113,7 +113,7 @@ namespace details template <typename Exception> [[noreturn]] void throw_exception(Exception&& exception) { - throw exception; + throw std::forward<Exception>(exception); } #endif |