summaryrefslogtreecommitdiffstats
path: root/libcxx/include
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/include')
-rw-r--r--libcxx/include/__config6
-rw-r--r--libcxx/include/cmath11
-rw-r--r--libcxx/include/cstddef36
-rw-r--r--libcxx/include/iterator6
-rw-r--r--libcxx/include/memory4
-rw-r--r--libcxx/include/thread5
-rw-r--r--libcxx/include/type_traits56
-rw-r--r--libcxx/include/utility8
8 files changed, 18 insertions, 114 deletions
diff --git a/libcxx/include/__config b/libcxx/include/__config
index d8b0a99a1f5..bb4e72ee12f 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -144,6 +144,10 @@ typedef __char32_t char32_t;
#define _LIBCPP_HAS_NO_VARIADICS
#endif
+#if !(__has_feature(cxx_trailing_return))
+#define _LIBCPP_HAS_NO_TRAILING_RETURN
+#endif
+
#if __has_feature(cxx_inline_namespaces)
#define _LIBCPP_BEGIN_NAMESPACE_STD namespace std {inline namespace _LIBCPP_NAMESPACE {
#define _LIBCPP_END_NAMESPACE_STD } }
@@ -190,6 +194,8 @@ using namespace _LIBCPP_NAMESPACE;
#else // __GXX_EXPERIMENTAL_CXX0X__
+#define _LIBCPP_HAS_NO_TRAILING_RETURN
+
#if !(__GNUC__ >= 4 && __GNUC_MINOR__ >= 3)
#define _LIBCPP_HAS_NO_RVALUE_REFERENCES
#endif
diff --git a/libcxx/include/cmath b/libcxx/include/cmath
index 8b7f2cf27d8..4d92841e988 100644
--- a/libcxx/include/cmath
+++ b/libcxx/include/cmath
@@ -297,12 +297,6 @@ long double truncl(long double x);
*/
-// FIXME: work around for Clang with -std=C++0x on OSX/iOS
-#if defined(__clang__) && defined(__APPLE__)
-# pragma push_macro("__STRICT_ANSI__")
-# undef __STRICT_ANSI__
-#endif // defined(__clang__) && defined(__APPLE__)
-
#include <__config>
#include <math.h>
#include <type_traits>
@@ -1587,9 +1581,4 @@ using ::truncl;
_LIBCPP_END_NAMESPACE_STD
-// FIXME: work around for Clang with -std=C++0x on OSX/iOS
-#if defined(__clang__) && defined(__APPLE__)
-# pragma pop_macro("__STRICT_ANSI__")
-#endif
-
#endif // _LIBCPP_CMATH
diff --git a/libcxx/include/cstddef b/libcxx/include/cstddef
index def48bcda3b..33886d421ef 100644
--- a/libcxx/include/cstddef
+++ b/libcxx/include/cstddef
@@ -78,42 +78,6 @@ struct _LIBCPP_VISIBLE nullptr_t
friend _LIBCPP_ALWAYS_INLINE bool operator<=(nullptr_t, nullptr_t) {return true;}
friend _LIBCPP_ALWAYS_INLINE bool operator>(nullptr_t, nullptr_t) {return false;}
friend _LIBCPP_ALWAYS_INLINE bool operator>=(nullptr_t, nullptr_t) {return true;}
-
- template <typename _Tp>
- friend _LIBCPP_ALWAYS_INLINE bool operator==(nullptr_t, _Tp* __p) {return 0 == __p;}
-
- template <typename _Tp>
- friend _LIBCPP_ALWAYS_INLINE bool operator==(_Tp* __p, nullptr_t) {return __p == 0;}
-
- template <class _Tp>
- friend _LIBCPP_ALWAYS_INLINE bool operator!=(nullptr_t, _Tp* __p) {return 0 != __p;}
-
- template <class _Tp>
- friend _LIBCPP_ALWAYS_INLINE bool operator!=(_Tp* __p, nullptr_t) {return __p != 0;}
-
- template <class _Tp>
- friend _LIBCPP_ALWAYS_INLINE bool operator<(nullptr_t, _Tp* __p) {return 0 < __p;}
-
- template <class _Tp>
- friend _LIBCPP_ALWAYS_INLINE bool operator<(_Tp* __p, nullptr_t) {return __p < 0;}
-
- template <class _Tp>
- friend _LIBCPP_ALWAYS_INLINE bool operator<=(nullptr_t, _Tp* __p) {return 0 <= __p;}
-
- template <class _Tp>
- friend _LIBCPP_ALWAYS_INLINE bool operator<=(_Tp* __p, nullptr_t) {return __p <= 0;}
-
- template <class _Tp>
- friend _LIBCPP_ALWAYS_INLINE bool operator>(nullptr_t, _Tp* __p) {return 0 > __p;}
-
- template <class _Tp>
- friend _LIBCPP_ALWAYS_INLINE bool operator>(_Tp* __p, nullptr_t) {return __p > 0;}
-
- template <class _Tp>
- friend _LIBCPP_ALWAYS_INLINE bool operator>=(nullptr_t, _Tp* __p) {return 0 >= __p;}
-
- template <class _Tp>
- friend _LIBCPP_ALWAYS_INLINE bool operator>=(_Tp* __p, nullptr_t) {return __p >= 0;}
};
inline _LIBCPP_ALWAYS_INLINE nullptr_t __get_nullptr_t() {return nullptr_t(0);}
diff --git a/libcxx/include/iterator b/libcxx/include/iterator
index f1a4f9c960a..7001c35c6cb 100644
--- a/libcxx/include/iterator
+++ b/libcxx/include/iterator
@@ -1616,7 +1616,7 @@ operator+(typename __debug_iter<_Container, _Iter>::difference_type __n,
#endif // _LIBCPP_DEBUG
-#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_DECLTYPE)
+#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_TRAILING_RETURN)
template <class _C>
inline _LIBCPP_INLINE_VISIBILITY
@@ -1650,7 +1650,7 @@ end(const _C& __c) -> decltype(__c.end())
return __c.end();
}
-#else // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_DECLTYPE)
+#else // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_TRAILING_RETURN)
template <class _C>
inline _LIBCPP_INLINE_VISIBILITY
@@ -1684,7 +1684,7 @@ end(const _C& __c)
return __c.end();
}
-#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_DECLTYPE)
+#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_TRAILING_RETURN)
template <class _T, size_t _N>
inline _LIBCPP_INLINE_VISIBILITY
diff --git a/libcxx/include/memory b/libcxx/include/memory
index 86da72159a1..c01615469bf 100644
--- a/libcxx/include/memory
+++ b/libcxx/include/memory
@@ -1471,7 +1471,7 @@ struct _LIBCPP_VISIBLE uses_allocator
{
};
-#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_ADVANCED_SFINAE)
+#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
// uses-allocator construction
@@ -1489,7 +1489,7 @@ struct __uses_alloc_ctor
: integral_constant<int, __uses_alloc_ctor_imp<_Tp, _Alloc, _Args...>::value>
{};
-#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_ADVANCED_SFINAE)
+#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
// allocator
diff --git a/libcxx/include/thread b/libcxx/include/thread
index 7b6cf9323f1..a4d3c4cce0f 100644
--- a/libcxx/include/thread
+++ b/libcxx/include/thread
@@ -253,13 +253,8 @@ class _LIBCPP_VISIBLE thread
{
pthread_t __t_;
-#ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS
- thread(const thread&) = delete;
- thread& operator=(const thread&) = delete;
-#else // _LIBCPP_HAS_NO_DELETED_FUNCTIONS
thread(const thread&);
thread& operator=(const thread&);
-#endif // _LIBCPP_HAS_NO_DELETED_FUNCTIONS
public:
typedef __thread_id id;
typedef pthread_t native_handle_type;
diff --git a/libcxx/include/type_traits b/libcxx/include/type_traits
index 82d1f91b12e..d3318cdcf63 100644
--- a/libcxx/include/type_traits
+++ b/libcxx/include/type_traits
@@ -1254,9 +1254,8 @@ private:
static _Tp __t();
static _Up __u();
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
- static bool __f();
public:
- typedef decltype(__f() ? __t() : __u()) type;
+ typedef decltype(true ? __t() : __u()) type;
};
#else // _LIBCPP_HAS_NO_VARIADICS
@@ -1335,11 +1334,10 @@ inline _LIBCPP_INLINE_VISIBILITY
typename remove_reference<_Tp>::type&&
move(_Tp&& __t)
{
- return static_cast<typename remove_reference<_Tp>::type&&>(__t);
+ typedef typename remove_reference<_Tp>::type _Up;
+ return static_cast<_Up&&>(__t);
}
-#if 1
-
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
_Tp&&
@@ -1358,54 +1356,6 @@ forward(typename std::remove_reference<_Tp>::type&& __t)
return static_cast<_Tp&&>(__t);
}
-#else
-
-template <class _Tp,
- class = typename enable_if<
- !is_lvalue_reference<_Tp>::value
- >::type
- >
-inline _LIBCPP_INLINE_VISIBILITY
-_Tp&&
-forward(typename common_type<_Tp>::type& __t)
-{
- return static_cast<_Tp&&>(__t);
-}
-
-template <class _Tp,
- class = typename enable_if<
- !is_lvalue_reference<_Tp>::value
- >::type
- >
-inline _LIBCPP_INLINE_VISIBILITY
-_Tp&&
-forward(typename common_type<_Tp>::type&& __t)
-{
- return static_cast<_Tp&&>(__t);
-}
-
-template <class _Tp,
- class = typename enable_if<
- is_lvalue_reference<_Tp>::value
- >::type
- >
-inline _LIBCPP_INLINE_VISIBILITY
-_Tp
-forward(typename common_type<_Tp>::type __t)
-{
- return __t;
-}
-
-template <class _Tp,
- class = typename enable_if<
- is_lvalue_reference<_Tp>::value
- >::type
- >
-_Tp
-forward(typename remove_reference<_Tp>::type&& __t) = delete;
-
-#endif
-
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Tp>
diff --git a/libcxx/include/utility b/libcxx/include/utility
index 1c1e4a3912b..3a6847a213d 100644
--- a/libcxx/include/utility
+++ b/libcxx/include/utility
@@ -218,8 +218,6 @@ struct _LIBCPP_VISIBLE pair
second(_STD::forward<_U2>(__u2))
{}
-#ifndef _LIBCPP_HAS_NO_VARIADICS
-
template<class _Tuple,
class = typename enable_if<__tuple_convertible<_Tuple, pair>::value>::type>
_LIBCPP_INLINE_VISIBILITY
@@ -230,6 +228,8 @@ struct _LIBCPP_VISIBLE pair
typename __make_tuple_types<_Tuple>::type>::type>(get<1>(__p)))
{}
+#ifndef _LIBCPP_HAS_NO_VARIADICS
+
template <class... _Args1, class... _Args2, size_t... _I1, size_t... _I2>
_LIBCPP_INLINE_VISIBILITY
pair(piecewise_construct_t __pc, tuple<_Args1...> __first_args,
@@ -239,6 +239,8 @@ struct _LIBCPP_VISIBLE pair
typename __make_tuple_indices<sizeof...(_Args2) >::type())
{}
+#endif // _LIBCPP_HAS_NO_VARIADICS
+
template <class _Tuple,
class = typename enable_if<__tuple_assignable<_Tuple, pair>::value>::type>
_LIBCPP_INLINE_VISIBILITY
@@ -253,8 +255,6 @@ struct _LIBCPP_VISIBLE pair
return *this;
}
-#endif // _LIBCPP_HAS_NO_VARIADICS
-
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
template<class _U1, class _U2>
_LIBCPP_INLINE_VISIBILITY pair(const pair<_U1, _U2>& __p)
OpenPOWER on IntegriCloud