From eb6c649d47714f820633e1b54d2ae92b11f1cdaa Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 29 Nov 2022 08:34:51 +0100 Subject: [PATCH] lib/fmt/SystemError: add concept check to work around ambiguous overloads --- src/lib/fmt/SystemError.hxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib/fmt/SystemError.hxx b/src/lib/fmt/SystemError.hxx index 6cab0a387..4fa66691d 100644 --- a/src/lib/fmt/SystemError.hxx +++ b/src/lib/fmt/SystemError.hxx @@ -36,6 +36,8 @@ #include #endif +#include + [[nodiscard]] [[gnu::pure]] std::system_error VFmtSystemError(std::error_code code, @@ -92,6 +94,7 @@ FmtLastError(const S &format_str, Args&&... args) noexcept #endif // _WIN32 template +requires(std::is_convertible_v) [[nodiscard]] [[gnu::pure]] std::system_error FmtErrno(int code, const S &format_str, Args&&... args) noexcept @@ -101,6 +104,7 @@ FmtErrno(int code, const S &format_str, Args&&... args) noexcept } template +requires(std::is_convertible_v) [[nodiscard]] [[gnu::pure]] std::system_error FmtErrno(const S &format_str, Args&&... args) noexcept @@ -109,6 +113,7 @@ FmtErrno(const S &format_str, Args&&... args) noexcept } template +requires(std::is_convertible_v) [[nodiscard]] [[gnu::pure]] std::system_error FmtFileNotFound(const S &format_str, Args&&... args) noexcept