Do not define template specialization __libcpp_is_floating_point<__fp16>
if the compiler is not clang. gcc doesn't allow using __fp16 on non-ARM targets. llvm-svn: 333108
This commit is contained in:
parent
3f66363139
commit
7b9bee064a
@ -733,7 +733,9 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_integral_v
|
||||
// is_floating_point
|
||||
|
||||
template <class _Tp> struct __libcpp_is_floating_point : public false_type {};
|
||||
#ifdef __clang__
|
||||
template <> struct __libcpp_is_floating_point<__fp16> : public true_type {};
|
||||
#endif
|
||||
#ifdef __FLT16_MANT_DIG__
|
||||
template <> struct __libcpp_is_floating_point<_Float16> : public true_type {};
|
||||
#endif
|
||||
|
@ -14,7 +14,9 @@
|
||||
#include <type_traits>
|
||||
|
||||
int main() {
|
||||
#ifdef __clang__
|
||||
static_assert(std::is_floating_point<__fp16>::value, "");
|
||||
#endif
|
||||
#ifdef __FLT16_MANT_DIG__
|
||||
static_assert(std::is_floating_point<_Float16>::value, "");
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user