Repository navigation
Fix develop CI: GCC 4.8, Clang 3.4 and clang-tidy errors - #6100
Merged
Merged
Conversation
- unit-json_patch.cpp: move multi-line raw strings out of CHECK(), which GCC 4.8 cannot parse inside a macro argument - unit-recursion_depth_limit.cpp: value-initialize the const std::hash (Clang 3.4 rejects default initialization of a const object) - json_view: silence modernize-use-transparent-functors (std::less<> is C++14), bugprone-suspicious-stringview-data-usage (the length comes from the node) and the deliberate use-after-clear() / owning-memory hits in unit-json_view_builder.cpp; use a raw string literal there Signed-off-by: Niels Lohmann <mail@nlohmann.me>
gregmarr
approved these changes
Nov 12, 2026
Test the lvalue path with the const original instead of a mutable copy and the rvalue path with a temporary (misc-const-correctness), and mark the intentional char8_t array with NOLINT (avoid-c-arrays). Signed-off-by: Niels Lohmann <mail@nlohmann.me>
4 of 6 tasks
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.
Several PRs merged on 2026-11-11 left develop red; the develop runs since then were all cancelled, so it showed up first in PR runs (e.g. #6078).
ci_test_compilers_gcc_old (4.8)):tests/src/unit-json_patch.cpp(Resume patch operations from the common prefix in constant time per step #6077) has multi-line raw strings insideCHECK(...), which GCC 4.8 cannot parse in a macro argument ("unterminated raw string"). The patches are now localconst jsonvariables.ci_test_compilers_clang (3.4)):tests/src/unit-recursion_depth_limit.cpp(Add JSON_RECURSION_DEPTH_LIMIT to set how deep value walks recurse #6081) default-initializes aconst std::hash<json>; it is now value-initialized.ci_clang_tidy):detail/view/document_data.hpp:modernize-use-transparent-functors—std::less<>is C++14, so NOLINT.detail/view/compare.hpp:bugprone-suspicious-stringview-data-usage—float_token_is_nan()takes the length from the node, so NOLINT.tests/src/unit-json_view_builder.cpp: raw string literal; NOLINT for the deliberate pointer use afterclear()(only compared, never read) and forowning-memoryonnew char[16].single_include/nlohmann/json_view.hppis regenerated withmake amalgamate.Checked locally: the three changed tests build and pass with Apple clang (C++11). Not checked locally: GCC 4.8, Clang 3.4 and clang-tidy 22; these jobs stop at the first failing file, so CI may still surface more.
Breaks the public API?
No. Only tests and NOLINT comments change.
🤖 Generated with Claude Code