From 5c8e590219f2b8217ce72f507139c4c28e8dbaee Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Fri, 21 Jun 2019 04:17:20 -0600 Subject: [PATCH] ircd: Fix default arguments in exception macros for clang. --- include/ircd/exception.h | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/include/ircd/exception.h b/include/ircd/exception.h index c377ffdc2..72cd83494 100644 --- a/include/ircd/exception.h +++ b/include/ircd/exception.h @@ -155,17 +155,24 @@ struct name \ :parent \ { \ template \ - name(const string_view &fmt = " ", args&&... ap) noexcept \ + name(const string_view &fmt, args&&... ap) noexcept \ :parent{generate_skip} \ { \ generate(#name, fmt, ircd::va_rtti{std::forward(ap)...}); \ } \ \ + template \ + name(const string_view &fmt = " ") noexcept \ + :parent{generate_skip} \ + { \ + generate(#name, fmt, ircd::va_rtti{}); \ + } \ + \ name(generate_skip_t) noexcept \ :parent{generate_skip} \ { \ } \ -}; \ +}; /// Hides the name of the exception when generating a string #define IRCD_EXCEPTION_HIDENAME(parent, name) \ @@ -173,12 +180,19 @@ struct name \ :parent \ { \ template \ - name(const string_view &fmt = " ", args&&... ap) noexcept \ + name(const string_view &fmt, args&&... ap) noexcept \ :parent{generate_skip} \ { \ generate(fmt, ircd::va_rtti{std::forward(ap)...}); \ } \ \ + template \ + name(const string_view &fmt = " ") noexcept \ + :parent{generate_skip} \ + { \ + generate(fmt, ircd::va_rtti{}); \ + } \ + \ name(generate_skip_t = {}) noexcept \ :parent{generate_skip} \ { \ @@ -197,18 +211,26 @@ struct name \ :parent \ { \ template \ - name(const string_view &fmt = " ", args&&... ap) noexcept \ + name(const string_view &fmt, args&&... ap) noexcept \ :parent{generate_skip} \ { \ generate(#name, fmt, ircd::va_rtti{std::forward(ap)...}); \ ircd::panicking(*this); \ } \ \ + template \ + name(const string_view &fmt = " ") noexcept \ + :parent{generate_skip} \ + { \ + generate(#name, fmt, ircd::va_rtti{}); \ + ircd::panicking(*this); \ + } \ + \ name(generate_skip_t) \ :parent{generate_skip} \ { \ } \ -}; \ +}; namespace ircd {