I have reverted all contributions made by Jesse Towner in revision 110724

llvm-svn: 119383
This commit is contained in:
Howard Hinnant 2010-11-16 21:10:23 +00:00
parent 8b67c720f2
commit c4931c4746
9 changed files with 21 additions and 134 deletions

View File

@ -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

View File

@ -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

View File

@ -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);}

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -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>

View File

@ -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)

View File

@ -24,12 +24,11 @@ int main()
"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 @@ int main()
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);
}