diff --git a/include/cpp_yyjson.hpp b/include/cpp_yyjson.hpp index 50c80f5..f309962 100644 --- a/include/cpp_yyjson.hpp +++ b/include/cpp_yyjson.hpp @@ -3827,6 +3827,10 @@ namespace yyjson template struct caster> { +#if defined(__GNUC__) or defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-value" +#endif template static std::variant from_json(const Json& json) { @@ -3835,6 +3839,9 @@ namespace yyjson if (result.has_value()) return *result; throw bad_cast(fmt::format("{} is not constructible from JSON", NAMEOF_TYPE(std::variant))); } +#if defined(__GNUC__) or defined(__clang__) +#pragma GCC diagnostic pop +#endif template requires requires(writer::value_ref& val) { ((val = std::declval()), ...); } diff --git a/include/field_reflection.hpp b/include/field_reflection.hpp index e2da000..da7ad1c 100644 --- a/include/field_reflection.hpp +++ b/include/field_reflection.hpp @@ -1,5 +1,5 @@ /*===================================================* -| field-reflection version v0.2.0 | +| field-reflection version v0.2.1 | | https://github.com/yosh-matsuda/field-reflection | | | | Copyright (c) 2024 Yoshiki Matsuda @yosh-matsuda | @@ -22,6 +22,11 @@ namespace field_reflection { namespace detail { + +#if defined(__GNUC__) || defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wundefined-inline" +#endif template struct any_lref { @@ -78,6 +83,9 @@ namespace field_reflection requires std::is_base_of_v constexpr operator U() const&& noexcept; // NOLINT }; +#if defined(__GNUC__) || defined(__clang__) +#pragma GCC diagnostic pop +#endif template concept constructible = []() { @@ -123,16 +131,13 @@ namespace field_reflection { return std::numeric_limits::max(); } + else if constexpr (constructible && !constructible) + { + return N; + } else { - if constexpr (constructible && !constructible) - { - return N; - } - else - { - return field_count_impl; - } + return field_count_impl; } }();