summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-06-01 14:16:03 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2024-06-01 14:16:03 +0100
commit181609cf16b1cf316ae3dc0a3458c0982f10c328 (patch)
tree31529bc4ece276561f419ac1533c806b4127c35f /lib
parentReformat with new clang-format (diff)
downloadilt-181609cf16b1cf316ae3dc0a3458c0982f10c328.tar.bz2
ilt-181609cf16b1cf316ae3dc0a3458c0982f10c328.tar.xz
ilt-181609cf16b1cf316ae3dc0a3458c0982f10c328.zip
Disable -Wenum-constexpr-conversion in parts of enumDetails.h
The parts used for finding valid values trigger constexpr invalid values warnings.
Diffstat (limited to 'lib')
-rw-r--r--lib/enumDetails.h13
1 files changed, 13 insertions, 0 deletions
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<static_cast<E>(n)>::valid...};
#pragma GCC diagnostic pop
}
@@ -93,7 +101,12 @@ private:
constexpr static auto
get_values(std::integer_sequence<int, n...>)
{
+#pragma GCC diagnostic push
+#ifdef __clang__
+# pragma GCC diagnostic ignored "-Wenum-constexpr-conversion"
+#endif
return std::array {EnumValueDetails<static_cast<E>(n)>::raw_value...};
+#pragma GCC diagnostic pop
}
template<auto... n>