mirror of
https://github.com/fmtlib/fmt.git
synced 2025-01-11 21:38:05 +00:00
Make FMT_ASSERT work in constexpr on clang 4.0.1
This commit is contained in:
parent
13d82e32bd
commit
b2d3a86ec0
@ -259,9 +259,9 @@ FMT_API void assert_fail(const char* file, int line, const char* message);
|
|||||||
# ifdef NDEBUG
|
# ifdef NDEBUG
|
||||||
# define FMT_ASSERT(condition, message)
|
# define FMT_ASSERT(condition, message)
|
||||||
# else
|
# else
|
||||||
# define FMT_ASSERT(condition, message) \
|
# define FMT_ASSERT(condition, message) \
|
||||||
((condition) \
|
((condition) /* void() fails with -Winvalid-constexpr on clang 4.0.1 */ \
|
||||||
? void() \
|
? (void)0 \
|
||||||
: ::fmt::internal::assert_fail(__FILE__, __LINE__, (message)))
|
: ::fmt::internal::assert_fail(__FILE__, __LINE__, (message)))
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
@ -947,12 +947,10 @@ template <typename Context> struct arg_mapper {
|
|||||||
map(static_cast<typename std::underlying_type<T>::type>(val))) {
|
map(static_cast<typename std::underlying_type<T>::type>(val))) {
|
||||||
return map(static_cast<typename std::underlying_type<T>::type>(val));
|
return map(static_cast<typename std::underlying_type<T>::type>(val));
|
||||||
}
|
}
|
||||||
template <
|
template <typename T,
|
||||||
typename T,
|
FMT_ENABLE_IF(!is_string<T>::value && !is_char<T>::value &&
|
||||||
FMT_ENABLE_IF(
|
(has_formatter<T, Context>::value ||
|
||||||
!is_string<T>::value && !is_char<T>::value &&
|
has_fallback_formatter<T, Context>::value))>
|
||||||
(has_formatter<T, Context>::value ||
|
|
||||||
has_fallback_formatter<T, Context>::value))>
|
|
||||||
FMT_CONSTEXPR const T& map(const T& val) {
|
FMT_CONSTEXPR const T& map(const T& val) {
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user