Skip to content

Commit cad0df8

Browse files
author
summivox
committed
fix fmtlib#2116 (FMT_COMPILE throws unmatched '{' on ESP32)
1 parent 373262f commit cad0df8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/fmt/compile.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ constexpr auto compile_format_string(S format_str) {
554554
using char_type = typename S::char_type;
555555
constexpr basic_string_view<char_type> str = format_str;
556556
if constexpr (str[POS] == '{') {
557-
if (POS + 1 == str.size())
557+
if constexpr (POS + 1 == str.size())
558558
throw format_error("unmatched '{' in format string");
559559
if constexpr (str[POS + 1] == '{') {
560560
return parse_tail<Args, POS + 2, ID>(make_text(str, POS, 1), format_str);
@@ -571,7 +571,7 @@ constexpr auto compile_format_string(S format_str) {
571571
return unknown_format();
572572
}
573573
} else if constexpr (str[POS] == '}') {
574-
if (POS + 1 == str.size())
574+
if constexpr (POS + 1 == str.size())
575575
throw format_error("unmatched '}' in format string");
576576
return parse_tail<Args, POS + 2, ID>(make_text(str, POS, 1), format_str);
577577
} else {

0 commit comments

Comments
 (0)