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. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@333108 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -733,7 +733,9 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_integral_v
|
|||||||
// is_floating_point
|
// is_floating_point
|
||||||
|
|
||||||
template <class _Tp> struct __libcpp_is_floating_point : public false_type {};
|
template <class _Tp> struct __libcpp_is_floating_point : public false_type {};
|
||||||
|
#ifdef __clang__
|
||||||
template <> struct __libcpp_is_floating_point<__fp16> : public true_type {};
|
template <> struct __libcpp_is_floating_point<__fp16> : public true_type {};
|
||||||
|
#endif
|
||||||
#ifdef __FLT16_MANT_DIG__
|
#ifdef __FLT16_MANT_DIG__
|
||||||
template <> struct __libcpp_is_floating_point<_Float16> : public true_type {};
|
template <> struct __libcpp_is_floating_point<_Float16> : public true_type {};
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -14,7 +14,9 @@
|
|||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
|
#ifdef __clang__
|
||||||
static_assert(std::is_floating_point<__fp16>::value, "");
|
static_assert(std::is_floating_point<__fp16>::value, "");
|
||||||
|
#endif
|
||||||
#ifdef __FLT16_MANT_DIG__
|
#ifdef __FLT16_MANT_DIG__
|
||||||
static_assert(std::is_floating_point<_Float16>::value, "");
|
static_assert(std::is_floating_point<_Float16>::value, "");
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user