Remove FMT_CONSTEXPR_DECL

This commit is contained in:
Victor Zverovich
2022-05-29 16:40:46 -07:00
parent d6b568a6cc
commit 1761e2666a
5 changed files with 15 additions and 19 deletions

View File

@@ -298,11 +298,9 @@ class text_style {
} }
} }
friend FMT_CONSTEXPR_DECL text_style friend FMT_CONSTEXPR text_style fg(detail::color_type foreground) noexcept;
fg(detail::color_type foreground) noexcept;
friend FMT_CONSTEXPR_DECL text_style friend FMT_CONSTEXPR text_style bg(detail::color_type background) noexcept;
bg(detail::color_type background) noexcept;
detail::color_type foreground_color; detail::color_type foreground_color;
detail::color_type background_color; detail::color_type background_color;

View File

@@ -102,10 +102,8 @@
#endif #endif
#if FMT_USE_CONSTEXPR #if FMT_USE_CONSTEXPR
# define FMT_CONSTEXPR constexpr # define FMT_CONSTEXPR constexpr
# define FMT_CONSTEXPR_DECL constexpr
#else #else
# define FMT_CONSTEXPR # define FMT_CONSTEXPR
# define FMT_CONSTEXPR_DECL
#endif #endif
#if ((__cplusplus >= 202002L) && \ #if ((__cplusplus >= 202002L) && \
@@ -116,7 +114,7 @@
# define FMT_CONSTEXPR20 # define FMT_CONSTEXPR20
#endif #endif
// Check if constexpr std::char_traits<>::compare,length is supported. // Check if constexpr std::char_traits<>::{compare,length} are supported.
#if defined(__GLIBCXX__) #if defined(__GLIBCXX__)
# if __cplusplus >= 201703L && defined(_GLIBCXX_RELEASE) && \ # if __cplusplus >= 201703L && defined(_GLIBCXX_RELEASE) && \
_GLIBCXX_RELEASE >= 7 // GCC 7+ libstdc++ has _GLIBCXX_RELEASE. _GLIBCXX_RELEASE >= 7 // GCC 7+ libstdc++ has _GLIBCXX_RELEASE.
@@ -253,7 +251,7 @@
#ifndef FMT_CONSTEVAL #ifndef FMT_CONSTEVAL
# if ((FMT_GCC_VERSION >= 1000 || FMT_CLANG_VERSION >= 1101) && \ # if ((FMT_GCC_VERSION >= 1000 || FMT_CLANG_VERSION >= 1101) && \
__cplusplus > 201703L && !defined(__apple_build_version__)) || \ __cplusplus >= 202002L && !defined(__apple_build_version__)) || \
(defined(__cpp_consteval) && \ (defined(__cpp_consteval) && \
(!FMT_MSC_VERSION || _MSC_FULL_VER >= 193030704)) (!FMT_MSC_VERSION || _MSC_FULL_VER >= 193030704))
// consteval is broken in MSVC before VS2022 and Apple clang 13. // consteval is broken in MSVC before VS2022 and Apple clang 13.

View File

@@ -2710,7 +2710,7 @@ class bigint {
return bigits_[to_unsigned(index)]; return bigits_[to_unsigned(index)];
} }
static FMT_CONSTEXPR_DECL const int bigit_bits = num_bits<bigit>(); static constexpr const int bigit_bits = num_bits<bigit>();
friend struct formatter<bigint>; friend struct formatter<bigint>;

View File

@@ -55,7 +55,7 @@ template <typename T> class is_std_string_like {
template <typename> static void check(...); template <typename> static void check(...);
public: public:
static FMT_CONSTEXPR_DECL const bool value = static constexpr const bool value =
is_string<T>::value || is_string<T>::value ||
std::is_convertible<T, std_string_view<char>>::value || std::is_convertible<T, std_string_view<char>>::value ||
!std::is_void<decltype(check<T>(nullptr))>::value; !std::is_void<decltype(check<T>(nullptr))>::value;
@@ -70,9 +70,9 @@ template <typename T> class is_map {
public: public:
#ifdef FMT_FORMAT_MAP_AS_LIST #ifdef FMT_FORMAT_MAP_AS_LIST
static FMT_CONSTEXPR_DECL const bool value = false; static constexpr const bool value = false;
#else #else
static FMT_CONSTEXPR_DECL const bool value = static constexpr const bool value =
!std::is_void<decltype(check<T>(nullptr))>::value; !std::is_void<decltype(check<T>(nullptr))>::value;
#endif #endif
}; };
@@ -83,9 +83,9 @@ template <typename T> class is_set {
public: public:
#ifdef FMT_FORMAT_SET_AS_LIST #ifdef FMT_FORMAT_SET_AS_LIST
static FMT_CONSTEXPR_DECL const bool value = false; static constexpr const bool value = false;
#else #else
static FMT_CONSTEXPR_DECL const bool value = static constexpr const bool value =
!std::is_void<decltype(check<T>(nullptr))>::value && !is_map<T>::value; !std::is_void<decltype(check<T>(nullptr))>::value && !is_map<T>::value;
#endif #endif
}; };
@@ -174,7 +174,7 @@ template <typename T> class is_tuple_like_ {
template <typename> static void check(...); template <typename> static void check(...);
public: public:
static FMT_CONSTEXPR_DECL const bool value = static constexpr const bool value =
!std::is_void<decltype(check<T>(nullptr))>::value; !std::is_void<decltype(check<T>(nullptr))>::value;
}; };
@@ -279,7 +279,7 @@ OutputIt write_range_entry(OutputIt out, const Arg& v) {
} // namespace detail } // namespace detail
template <typename T> struct is_tuple_like { template <typename T> struct is_tuple_like {
static FMT_CONSTEXPR_DECL const bool value = static constexpr const bool value =
detail::is_tuple_like_<T>::value && !detail::is_range_<T>::value; detail::is_tuple_like_<T>::value && !detail::is_range_<T>::value;
}; };
@@ -315,7 +315,7 @@ struct formatter<TupleT, Char, enable_if_t<fmt::is_tuple_like<TupleT>::value>> {
}; };
template <typename T, typename Char> struct is_range { template <typename T, typename Char> struct is_range {
static FMT_CONSTEXPR_DECL const bool value = static constexpr const bool value =
detail::is_range_<T>::value && !detail::is_std_string_like<T>::value && detail::is_range_<T>::value && !detail::is_std_string_like<T>::value &&
!detail::is_map<T>::value && !detail::is_map<T>::value &&
!std::is_convertible<T, std::basic_string<Char>>::value && !std::is_convertible<T, std::basic_string<Char>>::value &&

View File

@@ -1829,8 +1829,8 @@ fmt::string_view to_string_view(string_like) { return "foo"; }
constexpr char with_null[3] = {'{', '}', '\0'}; constexpr char with_null[3] = {'{', '}', '\0'};
constexpr char no_null[2] = {'{', '}'}; constexpr char no_null[2] = {'{', '}'};
static FMT_CONSTEXPR_DECL const char static_with_null[3] = {'{', '}', '\0'}; static constexpr const char static_with_null[3] = {'{', '}', '\0'};
static FMT_CONSTEXPR_DECL const char static_no_null[2] = {'{', '}'}; static constexpr const char static_no_null[2] = {'{', '}'};
TEST(format_test, compile_time_string) { TEST(format_test, compile_time_string) {
EXPECT_EQ("foo", fmt::format(FMT_STRING("foo"))); EXPECT_EQ("foo", fmt::format(FMT_STRING("foo")));