Skip to content

Commit

Permalink
fix #2116 (FMT_COMPILE requires exceptions enabled) (#2117)
Browse files Browse the repository at this point in the history
Co-authored-by: summivox <summivox@github.com>
  • Loading branch information
summivox and summivox authored Jan 28, 2021
1 parent 373262f commit b0b56b4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/fmt/compile.h
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ constexpr auto compile_format_string(S format_str) {
using char_type = typename S::char_type;
constexpr basic_string_view<char_type> str = format_str;
if constexpr (str[POS] == '{') {
if (POS + 1 == str.size())
if constexpr (POS + 1 == str.size())
throw format_error("unmatched '{' in format string");
if constexpr (str[POS + 1] == '{') {
return parse_tail<Args, POS + 2, ID>(make_text(str, POS, 1), format_str);
Expand All @@ -571,7 +571,7 @@ constexpr auto compile_format_string(S format_str) {
return unknown_format();
}
} else if constexpr (str[POS] == '}') {
if (POS + 1 == str.size())
if constexpr (POS + 1 == str.size())
throw format_error("unmatched '}' in format string");
return parse_tail<Args, POS + 2, ID>(make_text(str, POS, 1), format_str);
} else {
Expand Down

0 comments on commit b0b56b4

Please sign in to comment.