[libcxx] r345199 - Revert "Teach __libcpp_is_floating_point that __fp16 and _Float16 are"

Petr Hosek phosek at chromium.org
Wed Oct 24 14:29:16 PDT 2018


Author: phosek
Date: Wed Oct 24 14:29:15 2018
New Revision: 345199

URL: http://llvm.org/viewvc/llvm-project?rev=345199&view=rev
Log:
Revert "Teach __libcpp_is_floating_point that __fp16 and _Float16 are"

This reverts commits r333103 and r333108. _Float16 and __fp16 are C11
extensions and compilers other than Clang don't define these for C++.

Differential Revision: https://reviews.llvm.org/D53670

Removed:
    libcxx/trunk/test/libcxx/type_traits/is_floating_point.pass.cpp
Modified:
    libcxx/trunk/include/type_traits

Modified: libcxx/trunk/include/type_traits
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/type_traits?rev=345199&r1=345198&r2=345199&view=diff
==============================================================================
--- libcxx/trunk/include/type_traits (original)
+++ libcxx/trunk/include/type_traits Wed Oct 24 14:29:15 2018
@@ -738,12 +738,6 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR boo
 // 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
 template <>          struct __libcpp_is_floating_point<float>       : public true_type {};
 template <>          struct __libcpp_is_floating_point<double>      : public true_type {};
 template <>          struct __libcpp_is_floating_point<long double> : public true_type {};

Removed: libcxx/trunk/test/libcxx/type_traits/is_floating_point.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/type_traits/is_floating_point.pass.cpp?rev=345198&view=auto
==============================================================================
--- libcxx/trunk/test/libcxx/type_traits/is_floating_point.pass.cpp (original)
+++ libcxx/trunk/test/libcxx/type_traits/is_floating_point.pass.cpp (removed)
@@ -1,24 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// <type_traits>
-//
-// Test that is_floating_point<T>::value is true when T=__fp16 or T=_Float16.
-
-#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
-  return 0;
-}




More information about the libcxx-commits mailing list