From 932756efce53f5652a610401328c4f68093890e9 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 5 Mar 2021 13:17:22 +0100 Subject: [PATCH] win32/ComWorker: fix the FormatHResultError() return type Casting to std::runtime_error loses information (and prevents RVO). --- src/win32/HResult.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/win32/HResult.hxx b/src/win32/HResult.hxx index 2bc851f73..37d37a320 100644 --- a/src/win32/HResult.hxx +++ b/src/win32/HResult.hxx @@ -88,7 +88,7 @@ static inline const std::error_category &hresult_category() noexcept { return hresult_category_instance; } -gcc_printf(2, 3) static inline std::runtime_error +gcc_printf(2, 3) static inline std::system_error FormatHResultError(HRESULT result, const char *fmt, ...) noexcept { std::va_list args1, args2; va_start(args1, fmt);