@@ -7816,7 +7816,7 @@ struct is_ordered_map
78167816 template <typename C> static one test( decltype(&C::capacity) ) ;
78177817 template <typename C> static two test(...);
78187818
7819- enum { value = sizeof(test<T>(nullptr)) == sizeof(char) }; // NOLINT(cppcoreguidelines-pro-type-vararg,hicpp-vararg)
7819+ enum { value = sizeof(test<T>(nullptr)) == sizeof(char) }; // NOLINT(cppcoreguidelines-pro-type-vararg,hicpp-vararg,cppcoreguidelines-use-enum-class )
78207820};
78217821
78227822// to avoid useless casts (see https://github.com/nlohmann/json/issues/2893#issuecomment-889152324)
@@ -10481,7 +10481,7 @@ template<typename T>
1048110481struct is_iterator_of_multibyte
1048210482{
1048310483 using value_type = typename std::iterator_traits<T>::value_type;
10484- enum
10484+ enum // NOLINT(cppcoreguidelines-use-enum-class)
1048510485 {
1048610486 value = sizeof(value_type) > 1
1048710487 };
@@ -24890,7 +24890,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
2489024890
2489124891 /// @brief copy assignment
2489224892 /// @sa https://json.nlohmann.me/api/basic_json/operator=/
24893- basic_json& operator=(basic_json other) noexcept (
24893+ basic_json& operator=(basic_json other) noexcept ( // NOLINT(cppcoreguidelines-c-copy-assignment-signature,misc-unconventional-assign-operator)
2489424894 std::is_nothrow_move_constructible<value_t>::value&&
2489524895 std::is_nothrow_move_assignable<value_t>::value&&
2489624896 std::is_nothrow_move_constructible<json_value>::value&&
@@ -27762,6 +27762,22 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
2776227762 const bool ignore_comments = false,
2776327763 const bool ignore_trailing_commas = false)
2776427764 {
27765+ #if defined(__clang__)
27766+ #pragma clang diagnostic push
27767+ #pragma clang diagnostic ignored "-Wtautological-pointer-compare"
27768+ #elif defined(__GNUC__)
27769+ #pragma GCC diagnostic push
27770+ #pragma GCC diagnostic ignored "-Wnonnull-compare"
27771+ #endif
27772+ if (sax == nullptr)
27773+ {
27774+ JSON_THROW(other_error::create(502, "SAX handler must not be null", nullptr));
27775+ }
27776+ #if defined(__clang__)
27777+ #pragma clang diagnostic pop
27778+ #elif defined(__GNUC__)
27779+ #pragma GCC diagnostic pop
27780+ #endif
2776527781 auto ia = detail::input_adapter(std::forward<InputType>(i));
2776627782 return format == input_format_t::json
2776727783 ? parser(std::move(ia), nullptr, true, ignore_comments, ignore_trailing_commas).sax_parse(sax, strict)
@@ -27778,6 +27794,22 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
2777827794 const bool ignore_comments = false,
2777927795 const bool ignore_trailing_commas = false)
2778027796 {
27797+ #if defined(__clang__)
27798+ #pragma clang diagnostic push
27799+ #pragma clang diagnostic ignored "-Wtautological-pointer-compare"
27800+ #elif defined(__GNUC__)
27801+ #pragma GCC diagnostic push
27802+ #pragma GCC diagnostic ignored "-Wnonnull-compare"
27803+ #endif
27804+ if (sax == nullptr)
27805+ {
27806+ JSON_THROW(other_error::create(502, "SAX handler must not be null", nullptr));
27807+ }
27808+ #if defined(__clang__)
27809+ #pragma clang diagnostic pop
27810+ #elif defined(__GNUC__)
27811+ #pragma GCC diagnostic pop
27812+ #endif
2778127813 auto ia = detail::input_adapter(std::move(first), std::move(last));
2778227814 return format == input_format_t::json
2778327815 ? parser(std::move(ia), nullptr, true, ignore_comments, ignore_trailing_commas).sax_parse(sax, strict)
@@ -27798,6 +27830,22 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
2779827830 const bool ignore_comments = false,
2779927831 const bool ignore_trailing_commas = false)
2780027832 {
27833+ #if defined(__clang__)
27834+ #pragma clang diagnostic push
27835+ #pragma clang diagnostic ignored "-Wtautological-pointer-compare"
27836+ #elif defined(__GNUC__)
27837+ #pragma GCC diagnostic push
27838+ #pragma GCC diagnostic ignored "-Wnonnull-compare"
27839+ #endif
27840+ if (sax == nullptr)
27841+ {
27842+ JSON_THROW(other_error::create(502, "SAX handler must not be null", nullptr));
27843+ }
27844+ #if defined(__clang__)
27845+ #pragma clang diagnostic pop
27846+ #elif defined(__GNUC__)
27847+ #pragma GCC diagnostic pop
27848+ #endif
2780127849 auto ia = i.get();
2780227850 return format == input_format_t::json
2780327851 // NOLINTNEXTLINE(hicpp-move-const-arg,performance-move-const-arg)
@@ -29665,8 +29713,7 @@ class utf8_reader {
2966529713 }
2966629714 }
2966729715
29668- // Reverse bytes
29669- std::reverse(bytes.begin(), bytes.end());
29716+ // Never reached first byte
2967029717 return std::nullopt;
2967129718 }
2967229719 /// <summary>
@@ -30864,14 +30911,14 @@ class jsonh_reader : utf8_reader {
3086430911 nonstd::expected<jsonh_token, std::string> read_comment() noexcept {
3086530912 bool block_comment = false;
3086630913
30867- // Hash-styled comment
30914+ // Hash-style comment
3086830915 if (read_one("#")) {
3086930916 }
3087030917 else if (read_one("/")) {
30871- // Line-styled comment
30918+ // Line-style comment
3087230919 if (read_one("/")) {
3087330920 }
30874- // Block-styled comment
30921+ // Block-style comment
3087530922 else if (read_one("*")) {
3087630923 block_comment = true;
3087730924 }
0 commit comments