[cfe-commits] [libcxx] r119383 - in /libcxx/trunk: include/__config include/cmath include/cstddef include/iterator include/memory include/thread include/type_traits include/utility test/language.support/support.types/nullptr_t.pass.cpp

Howard Hinnant hhinnant at apple.com
Tue Nov 16 13:10:24 PST 2010


Author: hhinnant
Date: Tue Nov 16 15:10:23 2010
New Revision: 119383

URL: http://llvm.org/viewvc/llvm-project?rev=119383&view=rev
Log:
I have reverted all contributions made by Jesse Towner in revision 110724

Modified:
    libcxx/trunk/include/__config
    libcxx/trunk/include/cmath
    libcxx/trunk/include/cstddef
    libcxx/trunk/include/iterator
    libcxx/trunk/include/memory
    libcxx/trunk/include/thread
    libcxx/trunk/include/type_traits
    libcxx/trunk/include/utility
    libcxx/trunk/test/language.support/support.types/nullptr_t.pass.cpp

Modified: libcxx/trunk/include/__config
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config?rev=119383&r1=119382&r2=119383&view=diff
==============================================================================
--- libcxx/trunk/include/__config (original)
+++ libcxx/trunk/include/__config Tue Nov 16 15:10:23 2010
@@ -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

Modified: libcxx/trunk/include/cmath
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/cmath?rev=119383&r1=119382&r2=119383&view=diff
==============================================================================
--- libcxx/trunk/include/cmath (original)
+++ libcxx/trunk/include/cmath Tue Nov 16 15:10:23 2010
@@ -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

Modified: libcxx/trunk/include/cstddef
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/cstddef?rev=119383&r1=119382&r2=119383&view=diff
==============================================================================
--- libcxx/trunk/include/cstddef (original)
+++ libcxx/trunk/include/cstddef Tue Nov 16 15:10:23 2010
@@ -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);}

Modified: libcxx/trunk/include/iterator
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/iterator?rev=119383&r1=119382&r2=119383&view=diff
==============================================================================
--- libcxx/trunk/include/iterator (original)
+++ libcxx/trunk/include/iterator Tue Nov 16 15:10:23 2010
@@ -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

Modified: libcxx/trunk/include/memory
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/memory?rev=119383&r1=119382&r2=119383&view=diff
==============================================================================
--- libcxx/trunk/include/memory (original)
+++ libcxx/trunk/include/memory Tue Nov 16 15:10:23 2010
@@ -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
 

Modified: libcxx/trunk/include/thread
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/thread?rev=119383&r1=119382&r2=119383&view=diff
==============================================================================
--- libcxx/trunk/include/thread (original)
+++ libcxx/trunk/include/thread Tue Nov 16 15:10:23 2010
@@ -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;

Modified: libcxx/trunk/include/type_traits
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/type_traits?rev=119383&r1=119382&r2=119383&view=diff
==============================================================================
--- libcxx/trunk/include/type_traits (original)
+++ libcxx/trunk/include/type_traits Tue Nov 16 15:10:23 2010
@@ -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>

Modified: libcxx/trunk/include/utility
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/utility?rev=119383&r1=119382&r2=119383&view=diff
==============================================================================
--- libcxx/trunk/include/utility (original)
+++ libcxx/trunk/include/utility Tue Nov 16 15:10:23 2010
@@ -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)

Modified: libcxx/trunk/test/language.support/support.types/nullptr_t.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/language.support/support.types/nullptr_t.pass.cpp?rev=119383&r1=119382&r2=119383&view=diff
==============================================================================
--- libcxx/trunk/test/language.support/support.types/nullptr_t.pass.cpp (original)
+++ libcxx/trunk/test/language.support/support.types/nullptr_t.pass.cpp Tue Nov 16 15:10:23 2010
@@ -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);
 }





More information about the cfe-commits mailing list