From 24dd7c63f0ef18a0323d8750975728bd8f4ccd41 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Wed, 7 Oct 2026 09:03:17 +0200 Subject: [PATCH 1/2] Re-amalgamate after #5740 (#5777) #5740 changed include/nlohmann/json.hpp without regenerating single_include/nlohmann/json.hpp. Signed-off-by: Niels Lohmann --- single_include/nlohmann/json.hpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 431f76c02..e56ebfbad 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -32894,12 +32894,13 @@ public: input_format_t format = input_format_t::json, const bool strict = true, const bool ignore_comments = false, - const bool ignore_trailing_commas = false) + const bool ignore_trailing_commas = false, + const cbor_tag_handler_t tag_handler = cbor_tag_handler_t::error) { auto ia = detail::input_adapter(std::forward(i)); return format == input_format_t::json ? parser(std::move(ia), nullptr, true, ignore_comments, ignore_trailing_commas).sax_parse(sax, strict) - : detail::binary_reader(std::move(ia), format).sax_parse(sax, strict); + : detail::binary_reader(std::move(ia), format).sax_parse(sax, strict, tag_handler); } /// @brief generate SAX events (iterator pair, or iterator+sentinel pair for C++20 ranges support) @@ -32911,12 +32912,13 @@ public: input_format_t format = input_format_t::json, const bool strict = true, const bool ignore_comments = false, - const bool ignore_trailing_commas = false) + const bool ignore_trailing_commas = false, + const cbor_tag_handler_t tag_handler = cbor_tag_handler_t::error) { auto ia = detail::input_adapter(std::move(first), std::move(last)); return format == input_format_t::json ? parser(std::move(ia), nullptr, true, ignore_comments, ignore_trailing_commas).sax_parse(sax, strict) - : detail::binary_reader(std::move(ia), format).sax_parse(sax, strict); + : detail::binary_reader(std::move(ia), format).sax_parse(sax, strict, tag_handler); } /// @brief generate SAX events @@ -32944,7 +32946,8 @@ public: input_format_t format = input_format_t::json, const bool strict = true, const bool ignore_comments = false, - const bool ignore_trailing_commas = false) + const bool ignore_trailing_commas = false, + const cbor_tag_handler_t tag_handler = cbor_tag_handler_t::error) #if JSON_DELETE_DEPRECATED_FUNCTIONS = delete; #else @@ -32954,7 +32957,7 @@ public: // NOLINTNEXTLINE(hicpp-move-const-arg,performance-move-const-arg) ? parser(std::move(ia), nullptr, true, ignore_comments, ignore_trailing_commas).sax_parse(sax, strict) // NOLINTNEXTLINE(hicpp-move-const-arg,performance-move-const-arg) - : detail::binary_reader(std::move(ia), format).sax_parse(sax, strict); + : detail::binary_reader(std::move(ia), format).sax_parse(sax, strict, tag_handler); } #endif #if defined(__clang__) From 30e542e52a801dfb64aac8de0fbcbf8e7fa30da1 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Wed, 7 Oct 2026 09:03:18 +0200 Subject: [PATCH 2/2] Declare the namespace-scope constants in to_chars.hpp inline (#5776) MSVC warns with C5260 that kAlpha and kGamma have internal linkage when the header is used as a header unit or through a module. JSON_INLINE_VARIABLE makes them inline variables from C++17 on. Signed-off-by: Niels Lohmann --- include/nlohmann/detail/conversions/to_chars.hpp | 4 ++-- single_include/nlohmann/json.hpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/nlohmann/detail/conversions/to_chars.hpp b/include/nlohmann/detail/conversions/to_chars.hpp index c0945ab9e..52342db40 100644 --- a/include/nlohmann/detail/conversions/to_chars.hpp +++ b/include/nlohmann/detail/conversions/to_chars.hpp @@ -308,8 +308,8 @@ boundaries compute_boundaries(FloatType value) // // -e <= 60 or e >= -60 := alpha -constexpr int kAlpha = -60; -constexpr int kGamma = -32; +JSON_INLINE_VARIABLE constexpr int kAlpha = -60; +JSON_INLINE_VARIABLE constexpr int kGamma = -32; struct cached_power // c = f * 2^e ~= 10^k { diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index e56ebfbad..b7d344b72 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -24445,8 +24445,8 @@ boundaries compute_boundaries(FloatType value) // // -e <= 60 or e >= -60 := alpha -constexpr int kAlpha = -60; -constexpr int kGamma = -32; +JSON_INLINE_VARIABLE constexpr int kAlpha = -60; +JSON_INLINE_VARIABLE constexpr int kGamma = -32; struct cached_power // c = f * 2^e ~= 10^k {