I have reverted all contributions made by Jesse Towner in revision 110724
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@119383 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/__config b/include/__config
index d8b0a99..bb4e72e 100644
--- a/include/__config
+++ b/include/__config
@@ -144,6 +144,10 @@
#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 @@
#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/include/cmath b/include/cmath
index 8b7f2cf..4d92841 100644
--- a/include/cmath
+++ b/include/cmath
@@ -297,12 +297,6 @@
*/
-// 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 @@
_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/include/cstddef b/include/cstddef
index def48bc..33886d4 100644
--- a/include/cstddef
+++ b/include/cstddef
@@ -78,42 +78,6 @@
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/include/iterator b/include/iterator
index f1a4f9c..7001c35 100644
--- a/include/iterator
+++ b/include/iterator
@@ -1616,7 +1616,7 @@
#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 @@
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 @@
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/include/memory b/include/memory
index 86da721..c016154 100644
--- a/include/memory
+++ b/include/memory
@@ -1471,7 +1471,7 @@
{
};
-#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 @@
: 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/include/thread b/include/thread
index 7b6cf93..a4d3c4c 100644
--- a/include/thread
+++ b/include/thread
@@ -253,13 +253,8 @@
{
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/include/type_traits b/include/type_traits
index 82d1f91..d3318cd 100644
--- a/include/type_traits
+++ b/include/type_traits
@@ -1254,9 +1254,8 @@
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 @@
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 @@
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/include/utility b/include/utility
index 1c1e4a3..3a6847a 100644
--- a/include/utility
+++ b/include/utility
@@ -218,8 +218,6 @@
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 @@
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 @@
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 @@
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)
diff --git a/test/language.support/support.types/nullptr_t.pass.cpp b/test/language.support/support.types/nullptr_t.pass.cpp
index e1cbfe3..b169f1a 100644
--- a/test/language.support/support.types/nullptr_t.pass.cpp
+++ b/test/language.support/support.types/nullptr_t.pass.cpp
@@ -24,12 +24,11 @@
"sizeof(std::nullptr_t) == sizeof(void*)");
A* p = 0;
assert(p == nullptr);
- assert(nullptr == p);
-#if !((__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ <= 5))
- // GCC 4.2 through 4.5 can't handle this
void (A::*pmf)() = 0;
+#ifdef __clang__
+ // GCC 4.2 can't handle this
assert(pmf == nullptr);
-#endif // !((__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ <= 5))
+#endif
int A::*pmd = 0;
assert(pmd == nullptr);
A a1(nullptr);
@@ -42,20 +41,4 @@
assert(!(nullptr != nullptr));
assert(!(nullptr < nullptr));
assert(!(nullptr > nullptr));
- assert(!(&a1 == nullptr));
- assert(!(nullptr == &a1));
- assert(&a1 != nullptr);
- assert(nullptr != &a1);
- assert(nullptr < &a1);
- assert(nullptr <= &a1);
- assert(!(nullptr < p));
- assert(nullptr <= p);
- assert(!(&a1 < nullptr));
- assert(!(&a1 <= nullptr));
- assert(!(p < nullptr));
- assert(p <= nullptr);
- assert(!(nullptr > &a1));
- assert(!(nullptr >= &a1));
- assert(!(nullptr > p));
- assert(nullptr >= p);
}