mirror of
https://github.com/nlohmann/json.git
synced 2025-07-31 10:24:23 +03:00
Fix C++20/gcc-12 issues (Part 1) (#3379)
* 🔧 use proper GCC binary * 🔧 add more GCC warning flags * ⚗️ try fix from https://github.com/nlohmann/json/issues/3138#issuecomment-1015562666 * Fix custom allocator test build failures (C++20) Allocator tests fail to compile in C++20 mode with clang+MS STL due to missing copy constructors. * Fix test build failures due to missing noexcept (gcc-12) * alt_string has multiple member functions that should be marked noexcept. * nlohmann::ordered_map constructors can be noexcept. Compilation failures result from the warning flag -Werror=noexcept and gcc-12. * Disable broken comparison tests in C++20 mode Co-authored-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
committed by
GitHub
parent
4a6e6ca8c7
commit
f208a9c19b
@ -30,7 +30,8 @@ template <class Key, class T, class IgnoredLess = std::less<Key>,
|
||||
|
||||
// Explicit constructors instead of `using Container::Container`
|
||||
// otherwise older compilers choke on it (GCC <= 5.5, xcode <= 9.4)
|
||||
ordered_map(const Allocator& alloc = Allocator()) : Container{alloc} {}
|
||||
ordered_map() noexcept(noexcept(Container())) : Container{} {}
|
||||
explicit ordered_map(const Allocator& alloc) noexcept(noexcept(Container(alloc))) : Container{alloc} {}
|
||||
template <class It>
|
||||
ordered_map(It first, It last, const Allocator& alloc = Allocator())
|
||||
: Container{first, last, alloc} {}
|
||||
|
Reference in New Issue
Block a user