From ae62f89fe83a3a7a06295a98917e3a01cda9603d Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sat, 29 May 2021 15:04:19 -0500 Subject: [PATCH] [ox/std] Make oxThrowError do a move to satisfy clang-tidy --- deps/ox/src/ox/std/error.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/deps/ox/src/ox/std/error.hpp b/deps/ox/src/ox/std/error.hpp index 73f3e094..bcb6a14b 100644 --- a/deps/ox/src/ox/std/error.hpp +++ b/deps/ox/src/ox/std/error.hpp @@ -19,6 +19,7 @@ namespace ox { using ErrorCode = uint16_t; + struct [[nodiscard]] Error { const char *msg = nullptr; const char *file = nullptr; @@ -127,7 +128,7 @@ constexpr void oxIgnoreError(ox::Error) noexcept {} #define oxThrowError(x) if (const auto _ox_error = ox::detail::toError(x)) [[unlikely]] throw _ox_error #else #define oxReturnError(err) if (const auto _ox_error = ox::detail::toError(err)) return _ox_error -#define oxThrowError(err) if (const auto _ox_error = ox::detail::toError(err)) throw _ox_error +#define oxThrowError(err) if (const auto _ox_error = ox::detail::toError(err)) throw ox::move(_ox_error) #endif #define oxConcatImpl(a, b) a##b #define oxConcat(a, b) oxConcatImpl(a, b)