Skip to content

Commit 483eddc

Browse files
committed
Merge workarounds for MSVC bugs
1 parent b5c4e79 commit 483eddc

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

include/fmt/base.h

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@
126126
# define FMT_USE_CONSTEVAL 0
127127
#elif defined(__apple_build_version__) && __apple_build_version__ < 14000029L
128128
# define FMT_USE_CONSTEVAL 0 // consteval is broken in Apple clang < 14.
129-
#elif FMT_MSC_VERSION && FMT_MSC_VERSION < 1929
130-
# define FMT_USE_CONSTEVAL 0 // consteval is broken in MSVC VS2019 < 16.10.
129+
#elif FMT_MSC_VERSION && FMT_MSC_VERSION < 1940
130+
# define FMT_USE_CONSTEVAL 0 // consteval is broken in some MSVC2022 versions.
131131
#elif defined(__cpp_consteval)
132132
# define FMT_USE_CONSTEVAL 1
133133
#elif FMT_GCC_VERSION >= 1002 || FMT_CLANG_VERSION >= 1101
@@ -1834,12 +1834,7 @@ template <typename T> class buffer {
18341834

18351835
/// Appends data to the end of the buffer.
18361836
template <typename U>
1837-
// Workaround for MSVC2019 to fix error C2893: Failed to specialize function
1838-
// template 'void fmt::v11::detail::buffer<T>::append(const U *,const U *)'.
1839-
#if !FMT_MSC_VERSION || FMT_MSC_VERSION >= 1940
1840-
FMT_CONSTEXPR20
1841-
#endif
1842-
void append(const U* begin, const U* end) {
1837+
FMT_CONSTEXPR20 void append(const U* begin, const U* end) {
18431838
while (begin != end) {
18441839
auto size = size_;
18451840
auto free_cap = capacity_ - size;

include/fmt/format.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,7 @@ FMT_API void print(FILE*, string_view);
979979

980980
namespace detail {
981981
template <typename Char, size_t N> struct fixed_string {
982-
FMT_CONSTEXPR20 fixed_string(const Char (&s)[N]) {
982+
FMT_CONSTEXPR fixed_string(const Char (&s)[N]) {
983983
detail::copy<Char, const Char*, Char*>(static_cast<const Char*>(s), s + N,
984984
data);
985985
}

0 commit comments

Comments
 (0)