Assume __is_final,  __is_base_of, and friends.

All the compilers we support provide these builtins. We don't
need to do a configuration dance anymore.

This patch also cleans up some dead or almost dead
C++11 feature detection macros.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@364047 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/__config b/include/__config
index 0a175f6..3476115 100644
--- a/include/__config
+++ b/include/__config
@@ -443,18 +443,6 @@
 #define _LIBCPP_HAS_NO_VARIADICS
 #endif
 
-#if !(__has_feature(cxx_generalized_initializers))
-#define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
-#endif
-
-#if __has_feature(is_base_of)
-#define _LIBCPP_HAS_IS_BASE_OF
-#endif
-
-#if __has_feature(is_final)
-#define _LIBCPP_HAS_IS_FINAL
-#endif
-
 // Objective-C++ features (opt-in)
 #if __has_feature(objc_arc)
 #define _LIBCPP_HAS_OBJC_ARC
@@ -464,10 +452,6 @@
 #define _LIBCPP_HAS_OBJC_ARC_WEAK
 #endif
 
-#if !(__has_feature(cxx_constexpr))
-#define _LIBCPP_HAS_NO_CONSTEXPR
-#endif
-
 #if !(__has_feature(cxx_relaxed_constexpr))
 #define _LIBCPP_HAS_NO_CXX14_CONSTEXPR
 #endif
@@ -480,14 +464,6 @@
 #define _LIBCPP_HAS_NO_NOEXCEPT
 #endif
 
-#if __has_feature(underlying_type)
-#define _LIBCPP_UNDERLYING_TYPE(T) __underlying_type(T)
-#endif
-
-#if __has_feature(is_literal)
-#define _LIBCPP_IS_LITERAL(T) __is_literal(T)
-#endif
-
 #if !defined(_LIBCPP_HAS_NO_ASAN) && !__has_feature(address_sanitizer)
 #define _LIBCPP_HAS_NO_ASAN
 #endif
@@ -519,12 +495,6 @@
 
 #define _LIBCPP_NORETURN __attribute__((noreturn))
 
-#define _LIBCPP_UNDERLYING_TYPE(T) __underlying_type(T)
-#define _LIBCPP_IS_LITERAL(T) __is_literal_type(T)
-#define _LIBCPP_HAS_IS_FINAL
-
-#define _LIBCPP_HAS_IS_BASE_OF
-
 #if !__EXCEPTIONS && !defined(_LIBCPP_NO_EXCEPTIONS)
 #define _LIBCPP_NO_EXCEPTIONS
 #endif
@@ -563,8 +533,6 @@
 #error "MSVC versions prior to Visual Studio 2015 are not supported"
 #endif
 
-#define _LIBCPP_HAS_IS_BASE_OF
-#define _LIBCPP_HAS_NO_CONSTEXPR
 #define _LIBCPP_HAS_NO_CXX14_CONSTEXPR
 #define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES
 #define _LIBCPP_HAS_NO_NOEXCEPT
@@ -589,10 +557,7 @@
 #define _ATTRIBUTE(x) __attribute__((x))
 #define _LIBCPP_NORETURN __attribute__((noreturn))
 
-#define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 #define _LIBCPP_HAS_NO_UNICODE_CHARS
-#define _LIBCPP_HAS_IS_BASE_OF
-#define _LIBCPP_HAS_IS_FINAL
 #define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES
 
 #if defined(_AIX)
@@ -836,7 +801,7 @@
 # define decltype(...) __decltype(__VA_ARGS__)
 #endif  // _LIBCPP_CXX03_LANG
 
-#ifdef _LIBCPP_HAS_NO_CONSTEXPR
+#ifdef _LIBCPP_CXX03_LANG
 #  define _LIBCPP_CONSTEXPR
 #else
 #  define _LIBCPP_CONSTEXPR constexpr
diff --git a/include/future b/include/future
index 24396e7..6da88c6 100644
--- a/include/future
+++ b/include/future
@@ -408,11 +408,7 @@
 
 #ifndef _LIBCPP_HAS_NO_STRONG_ENUMS
 
-#ifdef _LIBCPP_UNDERLYING_TYPE
 typedef underlying_type<launch>::type __launch_underlying_type;
-#else
-typedef int __launch_underlying_type;
-#endif
 
 inline _LIBCPP_INLINE_VISIBILITY
 _LIBCPP_CONSTEXPR
diff --git a/include/type_traits b/include/type_traits
index 30e9c91..2cf54e2 100644
--- a/include/type_traits
+++ b/include/type_traits
@@ -1424,15 +1424,10 @@
 
 // is_final
 
-#if defined(_LIBCPP_HAS_IS_FINAL)
 template <class _Tp> struct _LIBCPP_TEMPLATE_VIS
 __libcpp_is_final : public integral_constant<bool, __is_final(_Tp)> {};
-#else
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS
-__libcpp_is_final : public false_type {};
-#endif
 
-#if defined(_LIBCPP_HAS_IS_FINAL) && _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER > 11
 template <class _Tp> struct _LIBCPP_TEMPLATE_VIS
 is_final : public integral_constant<bool, __is_final(_Tp)> {};
 #endif
@@ -1459,39 +1454,10 @@
 
 // is_base_of
 
-#ifdef _LIBCPP_HAS_IS_BASE_OF
-
 template <class _Bp, class _Dp>
 struct _LIBCPP_TEMPLATE_VIS is_base_of
     : public integral_constant<bool, __is_base_of(_Bp, _Dp)> {};
 
-#else  // _LIBCPP_HAS_IS_BASE_OF
-
-namespace __is_base_of_imp
-{
-template <class _Tp>
-struct _Dst
-{
-    _Dst(const volatile _Tp &);
-};
-template <class _Tp>
-struct _Src
-{
-    operator const volatile _Tp &();
-    template <class _Up> operator const _Dst<_Up> &();
-};
-template <size_t> struct __one { typedef char type; };
-template <class _Bp, class _Dp> typename __one<sizeof(_Dst<_Bp>(declval<_Src<_Dp> >()))>::type __test(int);
-template <class _Bp, class _Dp> __two __test(...);
-}
-
-template <class _Bp, class _Dp>
-struct _LIBCPP_TEMPLATE_VIS is_base_of
-    : public integral_constant<bool, is_class<_Bp>::value &&
-                                     sizeof(__is_base_of_imp::__test<_Bp, _Dp>(0)) == 2> {};
-
-#endif  // _LIBCPP_HAS_IS_BASE_OF
-
 #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
 template <class _Bp, class _Dp>
 _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_base_of_v
@@ -4182,12 +4148,7 @@
 // is_literal_type;
 
 template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_literal_type
-#ifdef _LIBCPP_IS_LITERAL
-    : public integral_constant<bool, _LIBCPP_IS_LITERAL(_Tp)>
-#else
-    : integral_constant<bool, is_scalar<typename remove_all_extents<_Tp>::type>::value ||
-                              is_reference<typename remove_all_extents<_Tp>::type>::value>
-#endif
+    : public integral_constant<bool, __is_literal_type(_Tp)>
     {};
 
 #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
@@ -4724,30 +4685,16 @@
 
 #endif // _LIBCPP_STD_VER > 14
 
-#ifdef _LIBCPP_UNDERLYING_TYPE
-
 template <class _Tp>
 struct underlying_type
 {
-    typedef _LIBCPP_UNDERLYING_TYPE(_Tp) type;
+    typedef __underlying_type(_Tp) type;
 };
 
 #if _LIBCPP_STD_VER > 11
 template <class _Tp> using underlying_type_t = typename underlying_type<_Tp>::type;
 #endif
 
-#else  // _LIBCPP_UNDERLYING_TYPE
-
-template <class _Tp, bool _Support = false>
-struct underlying_type
-{
-    static_assert(_Support, "The underyling_type trait requires compiler "
-                            "support. Either no such support exists or "
-                            "libc++ does not know how to use it.");
-};
-
-#endif // _LIBCPP_UNDERLYING_TYPE
-
 
 template <class _Tp, bool = is_enum<_Tp>::value>
 struct __sfinae_underlying_type