diff --git a/include/fmt/base.h b/include/fmt/base.h index a04dd5d9..d6cfbd37 100644 --- a/include/fmt/base.h +++ b/include/fmt/base.h @@ -276,15 +276,11 @@ # define FMT_OPTIMIZE_SIZE 0 #endif -// Specifies whether to handle built-in and string types specially. // FMT_BUILTIN_TYPE=0 may result in smaller library size at the cost of higher -// per-call binary size. +// per-call binary size by passing built-in types through the extension API. #ifndef FMT_BUILTIN_TYPES # define FMT_BUILTIN_TYPES 1 #endif -#if !FMT_BUILTIN_TYPES && !defined(__cpp_if_constexpr) -# error FMT_BUILTIN_TYPES=0 requires constexpr if support -#endif #define FMT_APPLY_VARIADIC(expr) \ using ignore = int[]; \ @@ -2195,7 +2191,7 @@ template class value { } FMT_CONSTEXPR FMT_INLINE value(const char_type* x FMT_BUILTIN) { string.data = x; - if (is_constant_evaluated()) string.size = {}; + if (is_constant_evaluated()) string.size = 0; } FMT_CONSTEXPR FMT_INLINE value(basic_string_view x FMT_BUILTIN) { string.data = x.data(); @@ -2238,11 +2234,6 @@ template class value { #if defined(__cpp_if_constexpr) if constexpr (!formattable) type_is_unformattable_for _; - if constexpr (std::is_same::value) { - int_value = x; // int is always handled as a built-in type. - return; - } - // T may overload operator& e.g. std::vector::reference in libc++. if constexpr (std::is_same*>::value) custom.value = const_cast(&x); diff --git a/include/fmt/format.h b/include/fmt/format.h index ad66aeb2..2a1fb1b9 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -1028,9 +1028,7 @@ FMT_API void print(std::FILE*, string_view); FMT_BEGIN_EXPORT // Suppress a misleading warning in older versions of clang. -#if FMT_CLANG_VERSION -# pragma clang diagnostic ignored "-Wweak-vtables" -#endif +FMT_CLANG_PRAGMA(diagnostic ignored "-Wweak-vtables") /// An error reported from a formatting function. class FMT_SO_VISIBILITY("default") format_error : public std::runtime_error {