Repository navigation
Fix CI failures on develop from the API performance stack - #5860
Merged
Merged
Conversation
- Mark the parameters of the new out-of-line throw helpers in json.hpp as used, as JSON_THROW drops its argument with JSON_NOEXCEPTION (clang -Wunused-parameter). - all_children_leaves() iterates with begin()/end() via std::all_of: a custom array_t such as the one in the custom_array_type example has no rbegin() (examples check, clang-tidy readability-use-anyofallof). - The rvalue to_json overloads (#5837) copy the elements of containers with const elements such as std::set instead of moving them: GCC 4.9's std::move_iterator cannot bind them. Object types are ruled out before std::ranges::view is checked, which needs an incomplete ordered_json for its object_t (GCC 11, C++20, unit-regression3 #3312). - NOLINT the rvalue to_json parameters that are deliberately not forwarded, and fix the other clang-tidy findings (modernize-use-auto in zmij.hpp, readability-math-missing-parentheses in json_pointer.hpp). - cpplint: NOLINT(readability/braces) on the new scalar fast-path macro like on JSON_IMPLEMENT_OPERATOR, and include <map> in json.hpp. - Tests: drop a useless cast (GCC -Wuseless-cast) and a signed/unsigned comparison (MSVC C4018), wrap a vector<json> comparison in parentheses so doctest does not try to print it (ambiguous operator<< on MSVC), and also strip JSON_DIAGNOSTIC_POSITIONS' "(bytes x-y) " from the patch messages in unit-throw_messages. - Windows clang (MinGW): link with LLD. unit-msgpack.cpp (C++11) and unit-regression2.cpp (C++20) have more than 32767 sections again (33363 and 33197), which GNU ld cannot link; LLD links them. Signed-off-by: Niels Lohmann <mail@nlohmann.me>
- ci_test_noexceptions: the JSON Patch section of unit-throw_messages and the strict dumps in unit-serialization catch exceptions, which JSON_NOEXCEPTION turns into std::abort(); skip them there. - ci_cppcheck: insert() and iter_impl::key() ended with a call to a noreturn throw helper, which Cppcheck reports as missingReturn; check the error case first and end with the return, like the other functions. - ci_single_binaries: ordered_map.hpp uses the Hedley macros since #5838, so include hedley.hpp (IWYU). - MSVC: also wrap the second vector<json> comparison in unit-constructor2 in parentheses. Signed-off-by: Niels Lohmann <mail@nlohmann.me>
- object_capacity() (#5832) overloaded a static with a non-static member function template, which MSVC 2015 rejects (C2686); make all three overloads non-static. - The JSON pointer hash constants (#5836) truncate on 32-bit size_t (C4309 with /WX); mask them to size_t's range before the cast. - unit-diagnostics: MSVC 2015 cannot use-declare the base's Container typedef (C2886); use alias declarations instead. Signed-off-by: Niels Lohmann <mail@nlohmann.me>
- unit-iterators1 (#5835) converted a json element to int implicitly, which does not compile with JSON_USE_IMPLICIT_CONVERSIONS=0. - unit-testsuites parses a number followed by a NUL byte, which JSON_STRICT_NUL_HANDLING rejects; leave the NUL out in strict mode. Signed-off-by: Niels Lohmann <mail@nlohmann.me>
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
The cast is useless where size_t is uint64_t (GCC -Wuseless-cast); the mask alone already keeps the constants in size_t's range. Signed-off-by: Niels Lohmann <mail@nlohmann.me>
- make_move_iterator_if_mutable takes the iterator by const reference
(performance-unnecessary-value-param).
- throw_patch_missing_member builds its message without a local that
is unused with JSON_NOEXCEPTION (bugprone-unused-local-non-trivial-variable).
- Tests: NOLINT the copies that test the copy constructor and the
constant mt19937 seed, NOLINT the deliberate "\xC3" "a" literal
concatenation, use references for the const views in
unit-throw_messages and return {} from its lambda.
A full clang-tidy 22 run over all 107 test translation units is clean.
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
… 2017 MSVC 2017 (/permissive- /std:c++17) rejects the braced std::vector<int> temporary inside CHECK() in this templated test case (C2440). Signed-off-by: Niels Lohmann <mail@nlohmann.me>
gregmarr
approved these changes
Oct 16, 2026
| n1e308[1] = '1'; | ||
| n1e308[310] = ']'; | ||
| #if JSON_STRICT_NUL_HANDLING | ||
| n1e308.resize(311); // a NUL byte after the value is a syntax error in strict mode |
Contributor
There was a problem hiding this comment.
pop_back() so the number can't get out of sync?
Owner
Author
There was a problem hiding this comment.
Done in 291dc5e: pop_back() now drops the last character, so the length is only stated once.
Written by Claude Code.
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
nlohmann
added a commit
that referenced
this pull request
Oct 16, 2026
Squashed onto develop cd6b428 (CI fixes from #5860). Original commits: - Append to the output vector through a position-tracking sink - Write CBOR integers without branching on their sign or size - Write MessagePack integers without branching on their sign or size - Use std::array for the integer size class table - Fix clang-tidy and GCC warnings in the integer array test - Regenerate the amalgamation Signed-off-by: Niels Lohmann <mail@nlohmann.me>
nlohmann
added a commit
that referenced
this pull request
Oct 16, 2026
Squashed onto develop cd6b428 (CI fixes from #5860). Original commits: - Fix silent wrong results for custom number types - Fix CI: build the out_of_range.407 message from string_t and fix a link - Fix CI: diagnostics message, clang-tidy, and MinGW section limit - Format the out_of_range.407 number without dump() - Move the std::deque array test out of unit-regression3.cpp - Fix clang-tidy and clang 3.4/3.5 failures in the custom number type changes - Fix CI: cast the 128-bit unsigned value explicitly in the integer fast path Signed-off-by: Niels Lohmann <mail@nlohmann.me>
nlohmann
added a commit
that referenced
this pull request
Oct 16, 2026
Squashed onto develop cd6b428 (CI fixes from #5860). Original commits: - Let the lexer's bulk fast paths run on a window of the input - Scan the get area of an input stream in bulk - Lock a FILE once per parse instead of once per character - Add benchmarks for parsing from a FILE* and for many values from a stream - Avoid implicit unsigned char to char conversion in stream tests - Make file_input_adapter::unlock() safe to call on a moved-from adapter Signed-off-by: Niels Lohmann <mail@nlohmann.me>
nlohmann
added a commit
that referenced
this pull request
Oct 16, 2026
…onversions Squashed onto develop cd6b428 (CI fixes from #5860). Original commits: - Add benchmarks for SAX parsing, value operations, JSON Pointer, and conversions - Time copies together with their destruction in the benchmarks - Time destroying the json in ToJsonStrings Signed-off-by: Niels Lohmann <mail@nlohmann.me>
nlohmann
added a commit
that referenced
this pull request
Oct 17, 2026
Squashed onto develop cd6b428 (CI fixes from #5860). Original commits: - Append to the output vector through a position-tracking sink - Write CBOR integers without branching on their sign or size - Write MessagePack integers without branching on their sign or size - Use std::array for the integer size class table - Fix clang-tidy and GCC warnings in the integer array test - Regenerate the amalgamation Signed-off-by: Niels Lohmann <mail@nlohmann.me>
nlohmann
added a commit
that referenced
this pull request
Oct 17, 2026
…onversions Squashed onto develop cd6b428 (CI fixes from #5860). Original commits: - Add benchmarks for SAX parsing, value operations, JSON Pointer, and conversions - Time copies together with their destruction in the benchmarks - Time destroying the json in ToJsonStrings Signed-off-by: Niels Lohmann <mail@nlohmann.me>
nlohmann
added a commit
that referenced
this pull request
Oct 17, 2026
Squashed onto develop cd6b428 (CI fixes from #5860). Original commits: - Let the lexer's bulk fast paths run on a window of the input - Scan the get area of an input stream in bulk - Lock a FILE once per parse instead of once per character - Add benchmarks for parsing from a FILE* and for many values from a stream - Avoid implicit unsigned char to char conversion in stream tests - Make file_input_adapter::unlock() safe to call on a moved-from adapter Signed-off-by: Niels Lohmann <mail@nlohmann.me>
nlohmann
added a commit
that referenced
this pull request
Oct 19, 2026
* Make parsing from std::istream and FILE* fast Squashed onto develop cd6b428 (CI fixes from #5860). Original commits: - Let the lexer's bulk fast paths run on a window of the input - Scan the get area of an input stream in bulk - Lock a FILE once per parse instead of once per character - Add benchmarks for parsing from a FILE* and for many values from a stream - Avoid implicit unsigned char to char conversion in stream tests - Make file_input_adapter::unlock() safe to call on a moved-from adapter Signed-off-by: Niels Lohmann <mail@nlohmann.me> * Add ABI tags for JSON_DISABLE_STREAM_BULK_SCAN and JSON_DISABLE_UNLOCKED_FILE_IO Both macros select between two definitions of an input adapter, so translation units compiled with different settings violated the ODR when linked together. Like the other ABI-affecting macros, they now append a tag to the inline namespace: _dsbs and _dufio. Their defaults move to abi_macros.hpp so that json_fwd.hpp sees them, and the natvis file is regenerated for the new namespaces. Signed-off-by: Niels Lohmann <mail@nlohmann.me> * Skip the exception-only checks of the stream input tests without exceptions Signed-off-by: Niels Lohmann <mail@nlohmann.me> --------- Signed-off-by: Niels Lohmann <mail@nlohmann.me>
nlohmann
added a commit
that referenced
this pull request
Oct 20, 2026
…onversions Squashed onto develop cd6b428 (CI fixes from #5860). Original commits: - Add benchmarks for SAX parsing, value operations, JSON Pointer, and conversions - Time copies together with their destruction in the benchmarks - Time destroying the json in ToJsonStrings Signed-off-by: Niels Lohmann <mail@nlohmann.me>
nlohmann
added a commit
that referenced
this pull request
Oct 21, 2026
* Speed up writing CBOR and MessagePack, above all integer arrays Squashed onto develop cd6b428 (CI fixes from #5860). Original commits: - Append to the output vector through a position-tracking sink - Write CBOR integers without branching on their sign or size - Write MessagePack integers without branching on their sign or size - Use std::array for the integer size class table - Fix clang-tidy and GCC warnings in the integer array test - Regenerate the amalgamation Signed-off-by: Niels Lohmann <mail@nlohmann.me> * Convert the streamed bytes explicitly in the binary writer sink tests Signed-off-by: Niels Lohmann <mail@nlohmann.me> --------- Signed-off-by: Niels Lohmann <mail@nlohmann.me>
nlohmann
added a commit
that referenced
this pull request
Oct 21, 2026
Squashed onto develop cd6b428 (CI fixes from #5860). Original commits: - Fix silent wrong results for custom number types - Fix CI: build the out_of_range.407 message from string_t and fix a link - Fix CI: diagnostics message, clang-tidy, and MinGW section limit - Format the out_of_range.407 number without dump() - Move the std::deque array test out of unit-regression3.cpp - Fix clang-tidy and clang 3.4/3.5 failures in the custom number type changes - Fix CI: cast the 128-bit unsigned value explicitly in the integer fast path Signed-off-by: Niels Lohmann <mail@nlohmann.me>
nlohmann
added a commit
that referenced
this pull request
Oct 21, 2026
* Fix silent wrong results for custom number types Squashed onto develop cd6b428 (CI fixes from #5860). Original commits: - Fix silent wrong results for custom number types - Fix CI: build the out_of_range.407 message from string_t and fix a link - Fix CI: diagnostics message, clang-tidy, and MinGW section limit - Format the out_of_range.407 number without dump() - Move the std::deque array test out of unit-regression3.cpp - Fix clang-tidy and clang 3.4/3.5 failures in the custom number type changes - Fix CI: cast the 128-bit unsigned value explicitly in the integer fast path Signed-off-by: Niels Lohmann <mail@nlohmann.me> * Name the range checks of integer_fits_max/min Signed-off-by: Niels Lohmann <mail@nlohmann.me> --------- Signed-off-by: Niels Lohmann <mail@nlohmann.me>
nlohmann
added a commit
that referenced
this pull request
Oct 21, 2026
…onversions Squashed onto develop cd6b428 (CI fixes from #5860). Original commits: - Add benchmarks for SAX parsing, value operations, JSON Pointer, and conversions - Time copies together with their destruction in the benchmarks - Time destroying the json in ToJsonStrings Signed-off-by: Niels Lohmann <mail@nlohmann.me>
nlohmann
added a commit
that referenced
this pull request
Oct 21, 2026
…onversions (#5845) Squashed onto develop cd6b428 (CI fixes from #5860). Original commits: - Add benchmarks for SAX parsing, value operations, JSON Pointer, and conversions - Time copies together with their destruction in the benchmarks - Time destroying the json in ToJsonStrings Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Develop is red since the API performance stack (#5831–#5842) was merged; every open PR inherits these failures. This fixes all failures of the last develop run (5683f5e):
ci_test_standards_clang (14, libstdcxx)(noexcept test)json.hppleave their parameters unused withJSON_NOEXCEPTIONstatic_cast<void>(...)like the helpers inexceptions.hppci_test_documentation (ci_test_examples)all_children_leaves()(#5835) callsrbegin(), whichcustom_array_typelacksstd::all_of(also fixes clang-tidyreadability-use-anyofallof)ci_test_compilers_gcc_old (4.9)to_json(#5837) moves fromstd::set's const elements; GCC 4.9'smove_iteratorcannot bind themci_test_compilers_gcc (11)(regression3, C++20)std::ranges::viewforordered_map, which needs the incompleteordered_json(#3312)ci_clang_tidyci_cpplintstd::mapwithout<map>JSON_IMPLEMENT_OPERATOR; include<map>ci_test_gcc,ci_test_standards_gcc (11)unit-json_pointer.cppunit-serialization.cpp; doctest tries to printvector<json>(ambiguousoperator<<withordered_json) inunit-constructor2.cppCHECK((copy == v))ci_test_diagnostic_positionsunit-throw_messagesstripped only theJSON_DIAGNOSTICSprefix(bytes x-y)clang (NN)(MinGW)unit-msgpack.cpp(C++11) andunit-regression2.cpp(C++20) exceed 32767 COFF sections again (33363/33197), which GNU ld cannot link-fuse-ld=lld), which ends the repeated test-file splittingVerified locally: gcc 4.9 and gcc 11 (Docker) build and pass the affected tests; clang builds of the touched tests with
-Werrorpass, with and without diagnostics/positions; cpplint is clean; LLD links the MinGWtest-msgpackobject that GNU ld rejects (Docker, clang 18). Running the MinGW binaries and clang-tidy is left to CI.Breaking changes
No breaking changes. Rvalue
std::set-like containers with const elements are now copied element by element instead of failing to compile on GCC 4.9; their observable result is unchanged.🤖 Generated with Claude Code