mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-24 03:17:53 +00:00
Enable compile-time error tests
This commit is contained in:
parent
450e8eed97
commit
811b0f9054
@ -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
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user