• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

nlohmann / json / 37026859850
99%

Build:
DEFAULT BRANCH: develop
Ran 03 Oct 2026 07:17AM UTC
Jobs 1
Files 36
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

02 Oct 2026 03:25PM UTC coverage: 98.737% (-0.04%) from 98.779%
37026859850

push

github

web-flow
Make comparisons with scalars noexcept only when the conversion is (#5751)

The comparison operators taking a scalar (==, !=, <, <=, >, >=, and
C++20's <=>) convert the scalar to a basic_json and compare, but were
unconditionally noexcept. When that conversion throws, the program
called std::terminate instead of propagating the exception, e.g. when
comparing a json with a string literal under memory pressure
(std::bad_alloc) or with an enum value not mapped by
NLOHMANN_JSON_SERIALIZE_ENUM_STRICT (out_of_range.410). clang-tidy
22.1 reports the latter as bugprone-exception-escape.

Declare the 16 scalar overloads
noexcept(std::is_nothrow_constructible<basic_json, ScalarType>::value):
they stay noexcept for numbers, Booleans, nullptr, and plain enums,
and are noexcept(false) for strings and enums whose to_json may throw.
The comparisons of two basic_json values are unchanged.

Restore the strict-enum comparisons removed from unit-conversions.cpp
in the previous PR, check that comparing an unmapped strict enum now
throws, and pin the new exception specifications in unit-noexcept.cpp.
Document the exception safety of overload (2) on all seven operator
pages. Ran make amalgamate.

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

3009 of 3138 branches covered (95.89%)

13 of 13 new or added lines in 1 file covered. (100.0%)

94 existing lines in 11 files now uncovered.

8519 of 8628 relevant lines covered (98.74%)

12934962.68 hits per line

Coverage Regressions

Lines Coverage ∆ File
49
97.52
-0.44% include/nlohmann/json.hpp
27
98.18
0.87% include/nlohmann/detail/input/binary_reader.hpp
7
97.19
-1.74% include/nlohmann/detail/input/number_parse.hpp
3
99.54
0.66% include/nlohmann/detail/input/lexer.hpp
2
95.92
-0.24% include/nlohmann/detail/string_utils.hpp
1
99.47
-0.05% include/nlohmann/detail/input/input_adapters.hpp
1
99.7
-0.01% include/nlohmann/detail/input/json_sax.hpp
1
99.43
1.1% include/nlohmann/detail/input/parser.hpp
1
99.69
0.0% include/nlohmann/detail/json_pointer.hpp
1
99.89
0.19% include/nlohmann/detail/output/binary_writer.hpp
1
99.81
0.15% include/nlohmann/detail/output/serializer.hpp
Jobs
ID Job ID Ran Files Coverage
1 37026859850.1 03 Oct 2026 07:17AM UTC 36
98.74
GitHub Action Run
Source Files on build 37026859850
  • Tree
  • List 36
  • Changed 22
  • Source Changed 22
  • Coverage Changed 19
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #37026859850
  • 6d0867a8 on github
  • Prev Build on develop (#36478524517)
  • Next Build on develop (#37231157998)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc