[libcxx] r232493 - Define a new macro: _LIBCPP_HAS_NO_VARIABLE_TEMPLATES and use it. No functionality change.

Marshall Clow mclow.lists at gmail.com
Tue Mar 17 08:30:23 PDT 2015


Author: marshall
Date: Tue Mar 17 10:30:22 2015
New Revision: 232493

URL: http://llvm.org/viewvc/llvm-project?rev=232493&view=rev
Log:
Define a new macro: _LIBCPP_HAS_NO_VARIABLE_TEMPLATES and use it. No functionality change.

Modified:
    libcxx/trunk/include/__config
    libcxx/trunk/include/experimental/chrono
    libcxx/trunk/include/experimental/ratio
    libcxx/trunk/include/experimental/system_error
    libcxx/trunk/include/experimental/type_traits

Modified: libcxx/trunk/include/__config
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config?rev=232493&r1=232492&r2=232493&view=diff
==============================================================================
--- libcxx/trunk/include/__config (original)
+++ libcxx/trunk/include/__config Tue Mar 17 10:30:22 2015
@@ -336,6 +336,10 @@ typedef __char32_t char32_t;
 #define _LIBCPP_HAS_NO_CXX14_CONSTEXPR
 #endif
 
+#if !(__has_feature(cxx_variable_templates))
+#define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES
+#endif
+
 #if __ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L
 #if defined(__FreeBSD__)
 #define _LIBCPP_HAS_QUICK_EXIT
@@ -415,6 +419,8 @@ namespace std {
 
 // No version of GCC supports relaxed constexpr rules
 #define _LIBCPP_HAS_NO_CXX14_CONSTEXPR
+// GCC 5 will support variable templates
+#define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES
 
 #define _NOEXCEPT throw()
 #define _NOEXCEPT_(x)
@@ -486,6 +492,7 @@ using namespace _LIBCPP_NAMESPACE __attr
 #define _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
 #define _LIBCPP_HAS_NO_CONSTEXPR
 #define _LIBCPP_HAS_NO_CXX14_CONSTEXPR
+#define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES
 #define _LIBCPP_HAS_NO_UNICODE_CHARS
 #define _LIBCPP_HAS_NO_DELETED_FUNCTIONS
 #define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
@@ -528,6 +535,7 @@ namespace std {
 #define _LIBCPP_HAS_NO_NULLPTR
 #define _LIBCPP_HAS_NO_UNICODE_CHARS
 #define _LIBCPP_HAS_IS_BASE_OF
+#define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES
 
 #if defined(_AIX)
 #define __MULTILOCALE_API

Modified: libcxx/trunk/include/experimental/chrono
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/experimental/chrono?rev=232493&r1=232492&r2=232493&view=diff
==============================================================================
--- libcxx/trunk/include/experimental/chrono (original)
+++ libcxx/trunk/include/experimental/chrono Tue Mar 17 10:30:22 2015
@@ -45,12 +45,12 @@ inline namespace fundamentals_v1 {
 
 _LIBCPP_BEGIN_NAMESPACE_CHRONO_LFTS
 
-#if __has_feature(cxx_variable_templates)
+#ifndef _LIBCPP_HAS_NO_VARIABLE_TEMPLATES
 
 template <class _Rep> _LIBCPP_CONSTEXPR bool treat_as_floating_point_v
     = treat_as_floating_point<_Rep>::value;
 
-#endif /* __has_feature(cxx_variable_templates) */
+#endif /* _LIBCPP_HAS_NO_VARIABLE_TEMPLATES */
 
 _LIBCPP_END_NAMESPACE_CHRONO_LFTS
 

Modified: libcxx/trunk/include/experimental/ratio
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/experimental/ratio?rev=232493&r1=232492&r2=232493&view=diff
==============================================================================
--- libcxx/trunk/include/experimental/ratio (original)
+++ libcxx/trunk/include/experimental/ratio Tue Mar 17 10:30:22 2015
@@ -48,7 +48,7 @@ inline namespace fundamentals_v1 {
 
 _LIBCPP_BEGIN_NAMESPACE_LFTS
 
-#if __has_feature(cxx_variable_templates)
+#ifndef _LIBCPP_HAS_NO_VARIABLE_TEMPLATES
 
 template <class _R1, class _R2> _LIBCPP_CONSTEXPR bool ratio_equal_v
     = ratio_equal<_R1, _R2>::value;
@@ -68,7 +68,7 @@ template <class _R1, class _R2> _LIBCPP_
 template <class _R1, class _R2> _LIBCPP_CONSTEXPR bool ratio_greater_equal_v
     = ratio_greater_equal<_R1, _R2>::value;
 
-#endif /* __has_feature(cxx_variable_templates) */
+#endif /* _LIBCPP_HAS_NO_VARIABLE_TEMPLATES */
 
 _LIBCPP_END_NAMESPACE_LFTS
 

Modified: libcxx/trunk/include/experimental/system_error
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/experimental/system_error?rev=232493&r1=232492&r2=232493&view=diff
==============================================================================
--- libcxx/trunk/include/experimental/system_error (original)
+++ libcxx/trunk/include/experimental/system_error Tue Mar 17 10:30:22 2015
@@ -46,7 +46,7 @@ inline namespace fundamentals_v1 {
 
 _LIBCPP_BEGIN_NAMESPACE_LFTS
 
-#if __has_feature(cxx_variable_templates)
+#ifndef _LIBCPP_HAS_NO_VARIABLE_TEMPLATES
 
 template <class _Tp> _LIBCPP_CONSTEXPR bool is_error_code_enum_v
     = is_error_code_enum<_Tp>::value;
@@ -54,7 +54,7 @@ template <class _Tp> _LIBCPP_CONSTEXPR b
 template <class _Tp> _LIBCPP_CONSTEXPR bool is_error_condition_enum_v
     = is_error_condition_enum<_Tp>::value;
 
-#endif /* __has_feature(cxx_variable_templates) */
+#endif /* _LIBCPP_HAS_NO_VARIABLE_TEMPLATES */
 
 _LIBCPP_END_NAMESPACE_LFTS
 

Modified: libcxx/trunk/include/experimental/type_traits
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/experimental/type_traits?rev=232493&r1=232492&r2=232493&view=diff
==============================================================================
--- libcxx/trunk/include/experimental/type_traits (original)
+++ libcxx/trunk/include/experimental/type_traits Tue Mar 17 10:30:22 2015
@@ -190,7 +190,7 @@ inline namespace fundamentals_v1 {
 
 _LIBCPP_BEGIN_NAMESPACE_LFTS
 
-#if __has_feature(cxx_variable_templates)
+#ifndef _LIBCPP_HAS_NO_VARIABLE_TEMPLATES
 
 // C++14 20.10.4.1, primary type categories
 
@@ -397,7 +397,7 @@ template <class _Tp, class _Up> _LIBCPP_
 template <class _Tp, class _Up> _LIBCPP_CONSTEXPR bool is_convertible_v
     = is_convertible<_Tp, _Up>::value;
 
-#endif /* __has_feature(cxx_variable_templates) */
+#endif /* _LIBCPP_HAS_NO_VARIABLE_TEMPLATES */
 
 // 3.3.2, Other type transformations
 /*





More information about the cfe-commits mailing list