diff --git a/include/nlohmann/json.hpp b/include/nlohmann/json.hpp index 269ee680a..6058d8fe1 100644 --- a/include/nlohmann/json.hpp +++ b/include/nlohmann/json.hpp @@ -3069,16 +3069,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec ValueType get_impl(detail::priority_tag<0> /*unused*/) const noexcept(noexcept( JSONSerializer::from_json(std::declval(), std::declval()))) { -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Weffc++" -#endif - // NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init,hicpp-member-init): see https://github.com/nlohmann/json/issues/3077 - ValueType ret; -#ifdef __GNUC__ -#pragma GCC diagnostic pop -#endif - + auto ret = ValueType(); JSONSerializer::from_json(*this, ret); return ret; } diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 8ca12791c..5cfd0086f 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -20556,16 +20556,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec ValueType get_impl(detail::priority_tag<0> /*unused*/) const noexcept(noexcept( JSONSerializer::from_json(std::declval(), std::declval()))) { -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Weffc++" -#endif - // NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init,hicpp-member-init): see https://github.com/nlohmann/json/issues/3077 - ValueType ret; -#ifdef __GNUC__ -#pragma GCC diagnostic pop -#endif - + auto ret = ValueType(); JSONSerializer::from_json(*this, ret); return ret; }