From 62a7412a958e16d1cb542a3601513c812cc899d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Kosi=C5=84ski?= Date: Mon, 11 May 2020 19:34:52 -0700 Subject: [PATCH] Replace direct uses of throw in fmt/compile.h with FMT_THROW. The current code fails to compile when exceptions are disabled. --- include/fmt/compile.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/fmt/compile.h b/include/fmt/compile.h index 35fe63f8..b5b9a782 100644 --- a/include/fmt/compile.h +++ b/include/fmt/compile.h @@ -468,7 +468,7 @@ constexpr auto compile_format_string(S format_str) { constexpr basic_string_view str = format_str; if constexpr (str[POS] == '{') { if (POS + 1 == str.size()) - throw format_error("unmatched '{' in format string"); + FMT_THROW(format_error("unmatched '{' in format string")); if constexpr (str[POS + 1] == '{') { return parse_tail(make_text(str, POS, 1), format_str); } else if constexpr (str[POS + 1] == '}') { @@ -484,7 +484,7 @@ constexpr auto compile_format_string(S format_str) { } } else if constexpr (str[POS] == '}') { if (POS + 1 == str.size()) - throw format_error("unmatched '}' in format string"); + FMT_THROW(format_error("unmatched '}' in format string")); return parse_tail(make_text(str, POS, 1), format_str); } else { constexpr auto end = parse_text(str, POS + 1);