mirror of
https://github.com/fmtlib/fmt.git
synced 2025-02-04 15:40:07 +00:00
Workaround yet another MSVC internal error
This commit is contained in:
parent
594bd8feba
commit
62af25dca8
@ -819,7 +819,7 @@ class null_terminating_iterator {
|
||||
return result;
|
||||
}
|
||||
|
||||
null_terminating_iterator operator--() {
|
||||
constexpr null_terminating_iterator operator--() {
|
||||
--ptr_;
|
||||
return *this;
|
||||
}
|
||||
@ -828,16 +828,16 @@ class null_terminating_iterator {
|
||||
return null_terminating_iterator(ptr_ + n, end_);
|
||||
}
|
||||
|
||||
null_terminating_iterator operator-(difference_type n) {
|
||||
constexpr null_terminating_iterator operator-(difference_type n) {
|
||||
return null_terminating_iterator(ptr_ - n, end_);
|
||||
}
|
||||
|
||||
null_terminating_iterator operator+=(difference_type n) {
|
||||
constexpr null_terminating_iterator operator+=(difference_type n) {
|
||||
ptr_ += n;
|
||||
return *this;
|
||||
}
|
||||
|
||||
difference_type operator-(null_terminating_iterator other) const {
|
||||
constexpr difference_type operator-(null_terminating_iterator other) const {
|
||||
return ptr_ - other.ptr_;
|
||||
}
|
||||
|
||||
@ -3573,6 +3573,7 @@ inline typename std::enable_if<
|
||||
constexpr bool invalid_format =
|
||||
internal::check_format_string<char, internal::error_handler, Args...>(
|
||||
string_view(format_str.value(), format_str.size()));
|
||||
(void)invalid_format;
|
||||
return vformat(format_str.value(), make_args(args...));
|
||||
}
|
||||
|
||||
|
@ -1870,16 +1870,17 @@ TEST(FormatTest, FormatStringErrors) {
|
||||
// This causes an internal compiler error in MSVC2017.
|
||||
EXPECT_ERROR("{0:=5", "unknown format specifier", char);
|
||||
EXPECT_ERROR("{:{<}", "invalid fill character '{'", int);
|
||||
EXPECT_ERROR("{:10000000000}", "number is too big", int);
|
||||
EXPECT_ERROR("{:.10000000000}", "number is too big", int);
|
||||
#endif
|
||||
EXPECT_ERROR("{foo", "missing '}' in format string", int);
|
||||
EXPECT_ERROR("{10000000000}", "number is too big");
|
||||
EXPECT_ERROR("{0x}", "invalid format string");
|
||||
EXPECT_ERROR("{-}", "invalid format string");
|
||||
EXPECT_ERROR("{1}", "argument index out of range", int);
|
||||
EXPECT_ERROR("{:10000000000}", "number is too big", int);
|
||||
EXPECT_ERROR("{:{0x}}", "invalid format string", int);
|
||||
EXPECT_ERROR("{:{-}}", "invalid format string", int);
|
||||
EXPECT_ERROR("{:.10000000000}", "number is too big", int);
|
||||
EXPECT_ERROR("{:.{0x}}", "invalid format string", int);
|
||||
EXPECT_ERROR("{:.{-}}", "invalid format string", int);
|
||||
EXPECT_ERROR("{:.x}", "missing precision specifier", int);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user