From 181609cf16b1cf316ae3dc0a3458c0982f10c328 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 1 Jun 2024 14:16:03 +0100 Subject: Disable -Wenum-constexpr-conversion in parts of enumDetails.h The parts used for finding valid values trigger constexpr invalid values warnings. --- lib/enumDetails.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/enumDetails.h b/lib/enumDetails.h index c68f7e8..dfae082 100644 --- a/lib/enumDetails.h +++ b/lib/enumDetails.h @@ -64,7 +64,12 @@ private: public: constexpr static std::string_view valueName {nameArr.data(), nameArr.size()}; constexpr static auto valid {valueName.back() < '0' || valueName.back() > '9'}; +#pragma GCC diagnostic push +#ifdef __clang__ +# pragma GCC diagnostic ignored "-Wenum-constexpr-conversion" +#endif constexpr static auto raw_value {value}; +#pragma GCC diagnostic pop }; /// EnumValueCollection @@ -85,6 +90,9 @@ private: { #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" +#ifdef __clang__ +# pragma GCC diagnostic ignored "-Wenum-constexpr-conversion" +#endif return std::array {EnumValueDetails(n)>::valid...}; #pragma GCC diagnostic pop } @@ -93,7 +101,12 @@ private: constexpr static auto get_values(std::integer_sequence) { +#pragma GCC diagnostic push +#ifdef __clang__ +# pragma GCC diagnostic ignored "-Wenum-constexpr-conversion" +#endif return std::array {EnumValueDetails(n)>::raw_value...}; +#pragma GCC diagnostic pop } template -- cgit v1.2.3