From dfcd851dba72a72859a6d5d9461e3d2e9a32d33b Mon Sep 17 00:00:00 2001 From: neargye Date: Wed, 4 Oct 2023 19:13:20 +0400 Subject: [PATCH] fix build --- include/magic_enum.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/magic_enum.hpp b/include/magic_enum.hpp index 69d2c72e6..4694878ad 100644 --- a/include/magic_enum.hpp +++ b/include/magic_enum.hpp @@ -424,7 +424,7 @@ constexpr auto n() noexcept { constexpr auto name = name_ptr ? str_view{name_ptr, std::char_traits::length(name_ptr)} : str_view{}; #elif defined(__clang__) str_view name; - if (sizeof(__PRETTY_FUNCTION__) == sizeof(__FUNCTION__)) { + if constexpr (sizeof(__PRETTY_FUNCTION__) == sizeof(__FUNCTION__)) { static_assert(always_false_v, "magic_enum::detail::n requires __PRETTY_FUNCTION__."); return str_view{}; } else { @@ -433,7 +433,7 @@ constexpr auto n() noexcept { } #elif defined(__GNUC__) auto name = str_view{__PRETTY_FUNCTION__, sizeof(__PRETTY_FUNCTION__) - 1}; - if (sizeof(__PRETTY_FUNCTION__) == sizeof(__FUNCTION__)) { + if constexpr (sizeof(__PRETTY_FUNCTION__) == sizeof(__FUNCTION__)) { static_assert(always_false_v, "magic_enum::detail::n requires __PRETTY_FUNCTION__."); return str_view{}; } else if (name.str_[name.size_ - 1] == ']') { @@ -500,7 +500,7 @@ constexpr auto n() noexcept { auto name = name_ptr ? str_view{name_ptr, std::char_traits::length(name_ptr)} : str_view{}; #elif defined(__clang__) str_view name; - if (sizeof(__PRETTY_FUNCTION__) == sizeof(__FUNCTION__)) { + if constexpr (sizeof(__PRETTY_FUNCTION__) == sizeof(__FUNCTION__)) { static_assert(always_false_v, "magic_enum::detail::n requires __PRETTY_FUNCTION__."); return str_view{}; } else { @@ -516,7 +516,7 @@ constexpr auto n() noexcept { } #elif defined(__GNUC__) auto name = str_view{__PRETTY_FUNCTION__, sizeof(__PRETTY_FUNCTION__) - 1}; - if (sizeof(__PRETTY_FUNCTION__) == sizeof(__FUNCTION__)) { + if constexpr (sizeof(__PRETTY_FUNCTION__) == sizeof(__FUNCTION__)) { static_assert(always_false_v, "magic_enum::detail::n requires __PRETTY_FUNCTION__."); return str_view{}; } else if (name.str_[name.size_ - 1] == ']') {