🔇 silence -Weffc++ warning
error: 'FooBar::foo' should be initialized in the member initialization list [-Werror=effc++]
This commit is contained in:
parent
d6740b4abd
commit
d698b6bf26
@ -3069,8 +3069,16 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
|
|||||||
ValueType get_impl(detail::priority_tag<0> /*unused*/) const noexcept(noexcept(
|
ValueType get_impl(detail::priority_tag<0> /*unused*/) const noexcept(noexcept(
|
||||||
JSONSerializer<ValueType>::from_json(std::declval<const basic_json_t&>(), std::declval<ValueType&>())))
|
JSONSerializer<ValueType>::from_json(std::declval<const basic_json_t&>(), std::declval<ValueType&>())))
|
||||||
{
|
{
|
||||||
|
#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
|
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init,hicpp-member-init): see https://github.com/nlohmann/json/issues/3077
|
||||||
ValueType ret;
|
ValueType ret;
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
#endif
|
||||||
|
|
||||||
JSONSerializer<ValueType>::from_json(*this, ret);
|
JSONSerializer<ValueType>::from_json(*this, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20556,8 +20556,16 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
|
|||||||
ValueType get_impl(detail::priority_tag<0> /*unused*/) const noexcept(noexcept(
|
ValueType get_impl(detail::priority_tag<0> /*unused*/) const noexcept(noexcept(
|
||||||
JSONSerializer<ValueType>::from_json(std::declval<const basic_json_t&>(), std::declval<ValueType&>())))
|
JSONSerializer<ValueType>::from_json(std::declval<const basic_json_t&>(), std::declval<ValueType&>())))
|
||||||
{
|
{
|
||||||
|
#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
|
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init,hicpp-member-init): see https://github.com/nlohmann/json/issues/3077
|
||||||
ValueType ret;
|
ValueType ret;
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
#endif
|
||||||
|
|
||||||
JSONSerializer<ValueType>::from_json(*this, ret);
|
JSONSerializer<ValueType>::from_json(*this, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -727,10 +727,7 @@ TEST_CASE("regression tests 2")
|
|||||||
json j;
|
json j;
|
||||||
j[0]["value"] = true;
|
j[0]["value"] = true;
|
||||||
std::vector<FooBar> foo;
|
std::vector<FooBar> foo;
|
||||||
DOCTEST_GCC_SUPPRESS_WARNING_PUSH
|
|
||||||
DOCTEST_GCC_SUPPRESS_WARNING(-Weffc++)
|
|
||||||
j.get_to(foo);
|
j.get_to(foo);
|
||||||
DOCTEST_GCC_SUPPRESS_WARNING_POP
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user