mirror of
https://github.com/fmtlib/fmt.git
synced 2025-01-29 21:32:49 +00:00
Fix build with MSVC C++20 modules (#3254)
When using fmt with C++20 modules under MSVC, it can end up requiring certain things to have storage that would not otherwise have needed to. Since I didn't see anything that was already doing detection for `inline constexpr` variable support, I've just moved the entire thing into the only function where it's used.
This commit is contained in:
parent
9e60304869
commit
7e5a959564
@ -395,9 +395,9 @@ FMT_CONSTEXPR auto to_unsigned(Int value) ->
|
||||
return static_cast<typename std::make_unsigned<Int>::type>(value);
|
||||
}
|
||||
|
||||
FMT_MSC_WARNING(suppress : 4566) constexpr unsigned char section[] = "\u00A7";
|
||||
FMT_CONSTEXPR inline auto is_utf8() -> bool {
|
||||
FMT_MSC_WARNING(suppress : 4566) constexpr unsigned char section[] = "\u00A7";
|
||||
|
||||
constexpr auto is_utf8() -> bool {
|
||||
// Avoid buggy sign extensions in MSVC's constant evaluation mode (#2297).
|
||||
using uchar = unsigned char;
|
||||
return FMT_UNICODE || (sizeof(section) == 3 && uchar(section[0]) == 0xC2 &&
|
||||
|
Loading…
x
Reference in New Issue
Block a user