3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-05-18 07:59:31 +00:00

Merge pull request #5882 from YosysHQ/std_cpp20

Bump required standard to C++20
This commit is contained in:
Miodrag Milanović 2026-05-15 13:13:43 +00:00 committed by GitHub
commit 1d87cefd80
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 42 additions and 32 deletions

View file

@ -804,8 +804,10 @@ std::string Fmt::render() const
buf += 'X';
else if (has_z)
buf += 'Z';
else
buf += (part.hex_upper ? "0123456789ABCDEF" : "0123456789abcdef")[subvalue.as_int()];
else {
const char *digits = part.hex_upper ? "0123456789ABCDEF" : "0123456789abcdef";
buf += digits[subvalue.as_int()];
}
}
} else if (part.base == 10) {
if (part.show_base)

View file

@ -475,7 +475,8 @@ public:
private:
std::string_view fmt;
bool has_escapes = false;
FoundFormatSpec specs[sizeof...(Args)] = {};
// Making array at least size of one to make MSVC happy and strict to standards
FoundFormatSpec specs[sizeof...(Args) ? sizeof...(Args) : 1] = {};
};
template <typename T> struct WrapType { using type = T; };

View file

@ -120,10 +120,10 @@
# define YS_MAYBE_UNUSED
#endif
#if __cplusplus >= 201703L
#if __cplusplus >= 202002L
# define YS_FALLTHROUGH [[fallthrough]];
#else
# error "C++17 or later compatible compiler is required"
# error "C++20 or later compatible compiler is required"
#endif
#if defined(__has_cpp_attribute) && __has_cpp_attribute(gnu::cold)