diff --git a/.clang-tidy b/.clang-tidy index 5ad3eea85..93deac3cb 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -31,3 +31,5 @@ Checks: '*, CheckOptions: - key: hicpp-special-member-functions.AllowSoleDefaultDtor value: 1 + +HeaderFilterRegex: '.*nlohmann.*' diff --git a/include/nlohmann/detail/iterators/iteration_proxy.hpp b/include/nlohmann/detail/iterators/iteration_proxy.hpp index 3e181d5d9..1b47faeb3 100644 --- a/include/nlohmann/detail/iterators/iteration_proxy.hpp +++ b/include/nlohmann/detail/iterators/iteration_proxy.hpp @@ -39,7 +39,7 @@ template class iteration_proxy_value /// a string representation of the array index mutable string_type array_index_str = "0"; /// an empty string (to return a reference for primitive values) - const string_type empty_str; + const string_type empty_str{}; public: explicit iteration_proxy_value(IteratorType it) noexcept : anchor(it) {} diff --git a/test/src/unit-udt.cpp b/test/src/unit-udt.cpp index 623d4bb2c..96398dbea 100644 --- a/test/src/unit-udt.cpp +++ b/test/src/unit-udt.cpp @@ -618,8 +618,8 @@ struct small_pod struct non_pod { - std::string s; - non_pod() : s() {} + std::string s{}; + non_pod() = default; non_pod(std::string S) : s(std::move(S)) {} };