From 54b96aa92b8955c70a3ed8c48ff4c08d585143c4 Mon Sep 17 00:00:00 2001 From: Xav83 Date: Fri, 20 Dec 2019 18:37:31 +0100 Subject: [PATCH] Ignores the cppcheck warnings about missing explicit keywords on constructor with one parameter in json.hpp. --- include/nlohmann/json.hpp | 5 +++++ single_include/nlohmann/json.hpp | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/include/nlohmann/json.hpp b/include/nlohmann/json.hpp index 104b1d5f6..8e98e03ea 100644 --- a/include/nlohmann/json.hpp +++ b/include/nlohmann/json.hpp @@ -1206,6 +1206,7 @@ class basic_json @since version 1.0.0 */ + // cppcheck-suppress noExplicitConstructor basic_json(const value_t v) : m_type(v), m_value(v) { @@ -1230,6 +1231,7 @@ class basic_json @since version 1.0.0 */ + // cppcheck-suppress noExplicitConstructor basic_json(std::nullptr_t = nullptr) noexcept : basic_json(value_t::null) { @@ -1297,6 +1299,7 @@ class basic_json typename U = detail::uncvref_t, detail::enable_if_t< not detail::is_basic_json::value and detail::is_compatible_type::value, int> = 0> + // cppcheck-suppress noExplicitConstructor basic_json(CompatibleType && val) noexcept(noexcept( JSONSerializer::to_json(std::declval(), std::forward(val)))) @@ -1334,6 +1337,7 @@ class basic_json template ::value and not std::is_same::value, int> = 0> + // cppcheck-suppress noExplicitConstructor basic_json(const BasicJsonType& val) { using other_boolean_t = typename BasicJsonType::boolean_t; @@ -1774,6 +1778,7 @@ class basic_json /////////////////////////////////////// /// @private + // cppcheck-suppress noExplicitConstructor basic_json(const detail::json_ref& ref) : basic_json(ref.moved_or_copied()) {} diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index e2a68e6f5..244244078 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -15749,6 +15749,7 @@ class basic_json @since version 1.0.0 */ + // cppcheck-suppress noExplicitConstructor basic_json(const value_t v) : m_type(v), m_value(v) { @@ -15773,6 +15774,7 @@ class basic_json @since version 1.0.0 */ + // cppcheck-suppress noExplicitConstructor basic_json(std::nullptr_t = nullptr) noexcept : basic_json(value_t::null) { @@ -15840,6 +15842,7 @@ class basic_json typename U = detail::uncvref_t, detail::enable_if_t< not detail::is_basic_json::value and detail::is_compatible_type::value, int> = 0> + // cppcheck-suppress noExplicitConstructor basic_json(CompatibleType && val) noexcept(noexcept( JSONSerializer::to_json(std::declval(), std::forward(val)))) @@ -15877,6 +15880,7 @@ class basic_json template ::value and not std::is_same::value, int> = 0> + // cppcheck-suppress noExplicitConstructor basic_json(const BasicJsonType& val) { using other_boolean_t = typename BasicJsonType::boolean_t; @@ -16317,6 +16321,7 @@ class basic_json /////////////////////////////////////// /// @private + // cppcheck-suppress noExplicitConstructor basic_json(const detail::json_ref& ref) : basic_json(ref.moved_or_copied()) {}