This commit is contained in:
Victor Zverovich 2016-11-07 08:55:40 -08:00
parent 85793a18cd
commit 55a1ac5035
2 changed files with 3 additions and 2 deletions

View File

@ -3631,7 +3631,8 @@ void vformat(BasicWriter<Char> &writer, BasicCStringRef<Char> format_str,
FMT_THROW(format_error("unmatched '}' in format string"));
internal::write(writer, start, s - 1);
format_arg<ArgFormatter>(writer, ctx.parse_arg_id(), ctx);
assert(*s == '}');
if (*s != '}')
FMT_THROW(format_error(fmt::format("unknown format specifier")));
start = ++s;
}
internal::write(writer, start, s);

View File

@ -1362,7 +1362,7 @@ void format_value(fmt::Writer &w, const Date &d, fmt::format_context &) {
TEST(FormatterTest, FormatCustom) {
Date date(2012, 12, 9);
EXPECT_THROW_MSG(fmt::format("{:s}", date), format_error,
"unmatched '}' in format string");
"unknown format specifier");
}
class Answer {};