diff --git a/Makefile b/Makefile index 1deb8da5..bfb62349 100644 --- a/Makefile +++ b/Makefile @@ -191,7 +191,10 @@ pedantic_gcc: -Wunused-macros \ -Wunused-parameter \ -Wuseless-cast \ - -Wvariadic-macros" + -Wvariadic-macros \ + -Wctor-dtor-privacy \ + -Winit-self \ + -Wstrict-null-sentinel" ########################################################################## # benchmarks diff --git a/include/nlohmann/detail/macro_scope.hpp b/include/nlohmann/detail/macro_scope.hpp index 5f0824fe..834ac241 100644 --- a/include/nlohmann/detail/macro_scope.hpp +++ b/include/nlohmann/detail/macro_scope.hpp @@ -115,11 +115,9 @@ contains a `mapped_type`, whereas `std::vector` fails the test. */ #define NLOHMANN_JSON_HAS_HELPER(type) \ template struct has_##type { \ - private: \ template \ static int detect(U &&); \ static void detect(...); \ - public: \ static constexpr bool value = \ std::is_integral()))>::value; \ } diff --git a/include/nlohmann/detail/meta/type_traits.hpp b/include/nlohmann/detail/meta/type_traits.hpp index caf81222..d3a6584d 100644 --- a/include/nlohmann/detail/meta/type_traits.hpp +++ b/include/nlohmann/detail/meta/type_traits.hpp @@ -141,14 +141,12 @@ struct is_compatible_integer_type template struct has_from_json { - private: // also check the return type of from_json template::from_json( std::declval(), std::declval()))>::value>> static int detect(U&&); static void detect(...); - public: static constexpr bool value = std::is_integral>()))>::value; }; @@ -158,7 +156,6 @@ struct has_from_json template struct has_non_default_from_json { - private: template < typename U, typename = enable_if_t>()))>::value; }; @@ -175,13 +171,11 @@ struct has_non_default_from_json template struct has_to_json { - private: template::to_json( std::declval(), std::declval()))> static int detect(U&&); static void detect(...); - public: static constexpr bool value = std::is_integral>()))>::value; }; diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index ac27d3d4..9984f14e 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -230,11 +230,9 @@ contains a `mapped_type`, whereas `std::vector` fails the test. */ #define NLOHMANN_JSON_HAS_HELPER(type) \ template struct has_##type { \ - private: \ template \ static int detect(U &&); \ static void detect(...); \ - public: \ static constexpr bool value = \ std::is_integral()))>::value; \ } @@ -471,14 +469,12 @@ struct is_compatible_integer_type template struct has_from_json { - private: // also check the return type of from_json template::from_json( std::declval(), std::declval()))>::value>> static int detect(U&&); static void detect(...); - public: static constexpr bool value = std::is_integral>()))>::value; }; @@ -488,7 +484,6 @@ struct has_from_json template struct has_non_default_from_json { - private: template < typename U, typename = enable_if_t>()))>::value; }; @@ -505,13 +499,11 @@ struct has_non_default_from_json template struct has_to_json { - private: template::to_json( std::declval(), std::declval()))> static int detect(U&&); static void detect(...); - public: static constexpr bool value = std::is_integral>()))>::value; };