diff --git a/include/nlohmann/json.hpp b/include/nlohmann/json.hpp index fe57b2766..4bbdc3f63 100644 --- a/include/nlohmann/json.hpp +++ b/include/nlohmann/json.hpp @@ -3420,7 +3420,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec /// @sa https://json.nlohmann.me/api/basic_json/insert/ iterator insert(const_iterator pos, basic_json&& val) // NOLINT(performance-unnecessary-value-param) { - return insert(pos, val); + return insert(std::move(pos), val); } /// @brief inserts copies of element into array diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 73c9d4ec2..77d29d3cb 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -24894,7 +24894,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec /// @sa https://json.nlohmann.me/api/basic_json/insert/ iterator insert(const_iterator pos, basic_json&& val) // NOLINT(performance-unnecessary-value-param) { - return insert(pos, val); + return insert(std::move(pos), val); } /// @brief inserts copies of element into array diff --git a/tests/src/unit-custom-object-type.cpp b/tests/src/unit-custom-object-type.cpp index c36dafff1..79b2ac6cc 100644 --- a/tests/src/unit-custom-object-type.cpp +++ b/tests/src/unit-custom-object-type.cpp @@ -37,7 +37,8 @@ struct no_key_compare_map : std::map using base_t = std::map; using base_t::base_t; - enum { key_compare }; // shadows base_t::key_compare, which is a type + // shadows base_t::key_compare, which is a type; never defined or called + void key_compare(); }; using no_key_compare_json = nlohmann::basic_json;