Enable compile-time error tests

This commit is contained in:
Victor Zverovich 2020-04-22 10:50:07 -07:00
parent 450e8eed97
commit 811b0f9054
2 changed files with 2 additions and 1 deletions

View File

@ -1692,6 +1692,7 @@ struct named_arg : view, named_arg_base<Char> {
: named_arg_base<Char>(name), value(val) {}
};
// Reports a compile-time error if S is not a valid format string.
template <typename..., typename S, FMT_ENABLE_IF(!is_compile_string<S>::value)>
FMT_INLINE void check_format_string(const S&) {
#ifdef FMT_ENFORCE_COMPILE_STRING

View File

@ -2470,7 +2470,7 @@ TEST(FormatTest, FormatStringErrors) {
EXPECT_ERROR_NOARGS("foo", nullptr);
EXPECT_ERROR_NOARGS("}", "unmatched '}' in format string");
EXPECT_ERROR("{0:s", "unknown format specifier", Date);
# if FMT_MSC_VER >= 1916
# if !FMT_MSC_VER || FMT_MSC_VER >= 1916
// This causes an internal compiler error in MSVC2017.
EXPECT_ERROR("{:{<}", "invalid fill character '{'", int);
EXPECT_ERROR("{:10000000000}", "number is too big", int);