[libcxx] r300413 - Replace _LIBCPP_HAS_NO_<C++03 feature> with _LIBCPP_CXX03_LANG in deque

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Sat Apr 15 20:17:01 PDT 2017


Author: ericwf
Date: Sat Apr 15 22:17:01 2017
New Revision: 300413

URL: http://llvm.org/viewvc/llvm-project?rev=300413&view=rev
Log:
Replace _LIBCPP_HAS_NO_<C++03 feature> with _LIBCPP_CXX03_LANG in deque

Modified:
    libcxx/trunk/include/deque
    libcxx/trunk/test/std/containers/sequences/deque/deque.cons/assign_initializer_list.pass.cpp
    libcxx/trunk/test/std/containers/sequences/deque/deque.cons/initializer_list.pass.cpp
    libcxx/trunk/test/std/containers/sequences/deque/deque.cons/initializer_list_alloc.pass.cpp
    libcxx/trunk/test/std/containers/sequences/deque/deque.cons/move.pass.cpp
    libcxx/trunk/test/std/containers/sequences/deque/deque.cons/move_alloc.pass.cpp
    libcxx/trunk/test/std/containers/sequences/deque/deque.cons/move_assign.pass.cpp
    libcxx/trunk/test/std/containers/sequences/deque/deque.cons/op_equal_initializer_list.pass.cpp
    libcxx/trunk/test/std/containers/sequences/deque/deque.modifiers/insert_iter_initializer_list.pass.cpp
    libcxx/trunk/test/std/containers/sequences/deque/deque.modifiers/push_back_rvalue.pass.cpp
    libcxx/trunk/test/std/containers/sequences/deque/deque.modifiers/push_front_rvalue.pass.cpp

Modified: libcxx/trunk/include/deque
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/deque?rev=300413&r1=300412&r2=300413&view=diff
==============================================================================
--- libcxx/trunk/include/deque (original)
+++ libcxx/trunk/include/deque Sat Apr 15 22:17:01 2017
@@ -968,13 +968,12 @@ protected:
 public:
     ~__deque_base();
 
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
+#ifndef _LIBCPP_CXX03_LANG
     __deque_base(__deque_base&& __c)
         _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value);
     __deque_base(__deque_base&& __c, const allocator_type& __a);
+#endif  // _LIBCPP_CXX03_LANG
 
-#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     void swap(__deque_base& __c)
 #if _LIBCPP_STD_VER >= 14
         _NOEXCEPT;
@@ -1108,7 +1107,7 @@ __deque_base<_Tp, _Allocator>::~__deque_
         __alloc_traits::deallocate(__alloc(), *__i, __block_size);
 }
 
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
 
 template <class _Tp, class _Allocator>
 __deque_base<_Tp, _Allocator>::__deque_base(__deque_base&& __c)
@@ -1140,7 +1139,7 @@ __deque_base<_Tp, _Allocator>::__deque_b
     }
 }
 
-#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif  // _LIBCPP_CXX03_LANG
 
 template <class _Tp, class _Allocator>
 void
@@ -1230,18 +1229,16 @@ public:
               typename enable_if<__is_input_iterator<_InputIter>::value>::type* = 0);
     deque(const deque& __c);
     deque(const deque& __c, const allocator_type& __a);
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
+    deque& operator=(const deque& __c);
+
+#ifndef _LIBCPP_CXX03_LANG
     deque(initializer_list<value_type> __il);
     deque(initializer_list<value_type> __il, const allocator_type& __a);
-#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
-    deque& operator=(const deque& __c);
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     _LIBCPP_INLINE_VISIBILITY
     deque& operator=(initializer_list<value_type> __il) {assign(__il); return *this;}
-#endif   // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     deque(deque&& __c) _NOEXCEPT_(is_nothrow_move_constructible<__base>::value);
     _LIBCPP_INLINE_VISIBILITY
@@ -1250,7 +1247,10 @@ public:
     deque& operator=(deque&& __c)
         _NOEXCEPT_(__alloc_traits::propagate_on_container_move_assignment::value &&
                    is_nothrow_move_assignable<allocator_type>::value);
-#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
+    _LIBCPP_INLINE_VISIBILITY
+    void assign(initializer_list<value_type> __il) {assign(__il.begin(), __il.end());}
+#endif  // _LIBCPP_CXX03_LANG
 
     template <class _InputIter>
         void assign(_InputIter __f, _InputIter __l,
@@ -1260,10 +1260,6 @@ public:
         void assign(_RAIter __f, _RAIter __l,
                     typename enable_if<__is_random_access_iterator<_RAIter>::value>::type* = 0);
     void assign(size_type __n, const value_type& __v);
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
-    _LIBCPP_INLINE_VISIBILITY
-    void assign(initializer_list<value_type> __il) {assign(__il.begin(), __il.end());}
-#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
     _LIBCPP_INLINE_VISIBILITY
     allocator_type get_allocator() const _NOEXCEPT;
@@ -1340,8 +1336,7 @@ public:
     // 23.2.2.3 modifiers:
     void push_front(const value_type& __v);
     void push_back(const value_type& __v);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#ifndef _LIBCPP_HAS_NO_VARIADICS
+#ifndef _LIBCPP_CXX03_LANG
 #if _LIBCPP_STD_VER > 14
     template <class... _Args> reference emplace_front(_Args&&... __args);
     template <class... _Args> reference emplace_back (_Args&&... __args);
@@ -1350,11 +1345,16 @@ public:
     template <class... _Args> void      emplace_back (_Args&&... __args);
 #endif
     template <class... _Args> iterator emplace(const_iterator __p, _Args&&... __args);
-#endif  // _LIBCPP_HAS_NO_VARIADICS
+
     void push_front(value_type&& __v);
     void push_back(value_type&& __v);
     iterator insert(const_iterator __p, value_type&& __v);
-#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
+    _LIBCPP_INLINE_VISIBILITY
+    iterator insert(const_iterator __p, initializer_list<value_type> __il)
+        {return insert(__p, __il.begin(), __il.end());}
+#endif  // _LIBCPP_CXX03_LANG
+
     iterator insert(const_iterator __p, const value_type& __v);
     iterator insert(const_iterator __p, size_type __n, const value_type& __v);
     template <class _InputIter>
@@ -1368,11 +1368,7 @@ public:
     template <class _BiIter>
         iterator insert(const_iterator __p, _BiIter __f, _BiIter __l,
                          typename enable_if<__is_bidirectional_iterator<_BiIter>::value>::type* = 0);
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
-    _LIBCPP_INLINE_VISIBILITY
-    iterator insert(const_iterator __p, initializer_list<value_type> __il)
-        {return insert(__p, __il.begin(), __il.end());}
-#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
     void pop_front();
     void pop_back();
     iterator erase(const_iterator __p);
@@ -1527,7 +1523,19 @@ deque<_Tp, _Allocator>::deque(const dequ
     __append(__c.begin(), __c.end());
 }
 
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+template <class _Tp, class _Allocator>
+deque<_Tp, _Allocator>&
+deque<_Tp, _Allocator>::operator=(const deque& __c)
+{
+    if (this != &__c)
+    {
+        __copy_assign_alloc(__c);
+        assign(__c.begin(), __c.end());
+    }
+    return *this;
+}
+
+#ifndef _LIBCPP_CXX03_LANG
 
 template <class _Tp, class _Allocator>
 deque<_Tp, _Allocator>::deque(initializer_list<value_type> __il)
@@ -1542,22 +1550,6 @@ deque<_Tp, _Allocator>::deque(initialize
     __append(__il.begin(), __il.end());
 }
 
-#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
-
-template <class _Tp, class _Allocator>
-deque<_Tp, _Allocator>&
-deque<_Tp, _Allocator>::operator=(const deque& __c)
-{
-    if (this != &__c)
-    {
-        __copy_assign_alloc(__c);
-        assign(__c.begin(), __c.end());
-    }
-    return *this;
-}
-
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
 template <class _Tp, class _Allocator>
 inline
 deque<_Tp, _Allocator>::deque(deque&& __c)
@@ -1613,7 +1605,7 @@ deque<_Tp, _Allocator>::__move_assign(de
     __base::__move_assign(__c);
 }
 
-#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif  // _LIBCPP_CXX03_LANG
 
 template <class _Tp, class _Allocator>
 template <class _InputIter>
@@ -1809,8 +1801,20 @@ deque<_Tp, _Allocator>::push_back(const
     ++__base::size();
 }
 
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+template <class _Tp, class _Allocator>
+void
+deque<_Tp, _Allocator>::push_front(const value_type& __v)
+{
+    allocator_type& __a = __base::__alloc();
+    if (__front_spare() == 0)
+        __add_front_capacity();
+    // __front_spare() >= 1
+    __alloc_traits::construct(__a, _VSTD::addressof(*--__base::begin()), __v);
+    --__base::__start_;
+    ++__base::size();
+}
 
+#ifndef _LIBCPP_CXX03_LANG
 template <class _Tp, class _Allocator>
 void
 deque<_Tp, _Allocator>::push_back(value_type&& __v)
@@ -1823,8 +1827,6 @@ deque<_Tp, _Allocator>::push_back(value_
     ++__base::size();
 }
 
-#ifndef _LIBCPP_HAS_NO_VARIADICS
-
 template <class _Tp, class _Allocator>
 template <class... _Args>
 #if _LIBCPP_STD_VER > 14
@@ -1846,24 +1848,6 @@ deque<_Tp, _Allocator>::emplace_back(_Ar
 #endif
 }
 
-#endif  // _LIBCPP_HAS_NO_VARIADICS
-#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-template <class _Tp, class _Allocator>
-void
-deque<_Tp, _Allocator>::push_front(const value_type& __v)
-{
-    allocator_type& __a = __base::__alloc();
-    if (__front_spare() == 0)
-        __add_front_capacity();
-    // __front_spare() >= 1
-    __alloc_traits::construct(__a, _VSTD::addressof(*--__base::begin()), __v);
-    --__base::__start_;
-    ++__base::size();
-}
-
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
 template <class _Tp, class _Allocator>
 void
 deque<_Tp, _Allocator>::push_front(value_type&& __v)
@@ -1877,7 +1861,6 @@ deque<_Tp, _Allocator>::push_front(value
     ++__base::size();
 }
 
-#ifndef _LIBCPP_HAS_NO_VARIADICS
 
 template <class _Tp, class _Allocator>
 template <class... _Args>
@@ -1900,12 +1883,9 @@ deque<_Tp, _Allocator>::emplace_front(_A
 #endif
 }
 
-#endif  // _LIBCPP_HAS_NO_VARIADICS
-#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
 template <class _Tp, class _Allocator>
 typename deque<_Tp, _Allocator>::iterator
-deque<_Tp, _Allocator>::insert(const_iterator __p, const value_type& __v)
+deque<_Tp, _Allocator>::insert(const_iterator __p, value_type&& __v)
 {
     size_type __pos = __p - __base::begin();
     size_type __to_end = __base::size() - __pos;
@@ -1917,23 +1897,20 @@ deque<_Tp, _Allocator>::insert(const_ite
         // __front_spare() >= 1
         if (__pos == 0)
         {
-            __alloc_traits::construct(__a, _VSTD::addressof(*--__base::begin()), __v);
+            __alloc_traits::construct(__a, _VSTD::addressof(*--__base::begin()), _VSTD::move(__v));
             --__base::__start_;
             ++__base::size();
         }
         else
         {
-            const_pointer __vt = pointer_traits<const_pointer>::pointer_to(__v);
             iterator __b = __base::begin();
             iterator __bm1 = _VSTD::prev(__b);
-            if (__vt == pointer_traits<const_pointer>::pointer_to(*__b))
-                __vt = pointer_traits<const_pointer>::pointer_to(*__bm1);
             __alloc_traits::construct(__a, _VSTD::addressof(*__bm1), _VSTD::move(*__b));
             --__base::__start_;
             ++__base::size();
             if (__pos > 1)
-                __b = __move_and_check(_VSTD::next(__b), __b + __pos, __b, __vt);
-            *__b = *__vt;
+                __b = _VSTD::move(_VSTD::next(__b), __b + __pos, __b);
+            *__b = _VSTD::move(__v);
         }
     }
     else
@@ -1944,31 +1921,27 @@ deque<_Tp, _Allocator>::insert(const_ite
         size_type __de = __base::size() - __pos;
         if (__de == 0)
         {
-            __alloc_traits::construct(__a, _VSTD::addressof(*__base::end()), __v);
+            __alloc_traits::construct(__a, _VSTD::addressof(*__base::end()), _VSTD::move(__v));
             ++__base::size();
         }
         else
         {
-            const_pointer __vt = pointer_traits<const_pointer>::pointer_to(__v);
             iterator __e = __base::end();
             iterator __em1 = _VSTD::prev(__e);
-            if (__vt == pointer_traits<const_pointer>::pointer_to(*__em1))
-                __vt = pointer_traits<const_pointer>::pointer_to(*__e);
             __alloc_traits::construct(__a, _VSTD::addressof(*__e), _VSTD::move(*__em1));
             ++__base::size();
             if (__de > 1)
-                __e = __move_backward_and_check(__e - __de, __em1, __e, __vt);
-            *--__e = *__vt;
+                __e = _VSTD::move_backward(__e - __de, __em1, __e);
+            *--__e = _VSTD::move(__v);
         }
     }
     return __base::begin() + __pos;
 }
 
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
 template <class _Tp, class _Allocator>
+template <class... _Args>
 typename deque<_Tp, _Allocator>::iterator
-deque<_Tp, _Allocator>::insert(const_iterator __p, value_type&& __v)
+deque<_Tp, _Allocator>::emplace(const_iterator __p, _Args&&... __args)
 {
     size_type __pos = __p - __base::begin();
     size_type __to_end = __base::size() - __pos;
@@ -1980,12 +1953,13 @@ deque<_Tp, _Allocator>::insert(const_ite
         // __front_spare() >= 1
         if (__pos == 0)
         {
-            __alloc_traits::construct(__a, _VSTD::addressof(*--__base::begin()), _VSTD::move(__v));
+            __alloc_traits::construct(__a, _VSTD::addressof(*--__base::begin()), _VSTD::forward<_Args>(__args)...);
             --__base::__start_;
             ++__base::size();
         }
         else
         {
+            __temp_value<value_type, _Allocator> __tmp(this->__alloc(), _VSTD::forward<_Args>(__args)...);
             iterator __b = __base::begin();
             iterator __bm1 = _VSTD::prev(__b);
             __alloc_traits::construct(__a, _VSTD::addressof(*__bm1), _VSTD::move(*__b));
@@ -1993,7 +1967,7 @@ deque<_Tp, _Allocator>::insert(const_ite
             ++__base::size();
             if (__pos > 1)
                 __b = _VSTD::move(_VSTD::next(__b), __b + __pos, __b);
-            *__b = _VSTD::move(__v);
+            *__b = _VSTD::move(__tmp.get());
         }
     }
     else
@@ -2004,29 +1978,30 @@ deque<_Tp, _Allocator>::insert(const_ite
         size_type __de = __base::size() - __pos;
         if (__de == 0)
         {
-            __alloc_traits::construct(__a, _VSTD::addressof(*__base::end()), _VSTD::move(__v));
+            __alloc_traits::construct(__a, _VSTD::addressof(*__base::end()), _VSTD::forward<_Args>(__args)...);
             ++__base::size();
         }
         else
         {
+            __temp_value<value_type, _Allocator> __tmp(this->__alloc(), _VSTD::forward<_Args>(__args)...);
             iterator __e = __base::end();
             iterator __em1 = _VSTD::prev(__e);
             __alloc_traits::construct(__a, _VSTD::addressof(*__e), _VSTD::move(*__em1));
             ++__base::size();
             if (__de > 1)
                 __e = _VSTD::move_backward(__e - __de, __em1, __e);
-            *--__e = _VSTD::move(__v);
+            *--__e = _VSTD::move(__tmp.get());
         }
     }
     return __base::begin() + __pos;
 }
 
-#ifndef _LIBCPP_HAS_NO_VARIADICS
+#endif  // _LIBCPP_CXX03_LANG
+
 
 template <class _Tp, class _Allocator>
-template <class... _Args>
 typename deque<_Tp, _Allocator>::iterator
-deque<_Tp, _Allocator>::emplace(const_iterator __p, _Args&&... __args)
+deque<_Tp, _Allocator>::insert(const_iterator __p, const value_type& __v)
 {
     size_type __pos = __p - __base::begin();
     size_type __to_end = __base::size() - __pos;
@@ -2038,21 +2013,23 @@ deque<_Tp, _Allocator>::emplace(const_it
         // __front_spare() >= 1
         if (__pos == 0)
         {
-            __alloc_traits::construct(__a, _VSTD::addressof(*--__base::begin()), _VSTD::forward<_Args>(__args)...);
+            __alloc_traits::construct(__a, _VSTD::addressof(*--__base::begin()), __v);
             --__base::__start_;
             ++__base::size();
         }
         else
         {
-            __temp_value<value_type, _Allocator> __tmp(this->__alloc(), _VSTD::forward<_Args>(__args)...);
+            const_pointer __vt = pointer_traits<const_pointer>::pointer_to(__v);
             iterator __b = __base::begin();
             iterator __bm1 = _VSTD::prev(__b);
+            if (__vt == pointer_traits<const_pointer>::pointer_to(*__b))
+                __vt = pointer_traits<const_pointer>::pointer_to(*__bm1);
             __alloc_traits::construct(__a, _VSTD::addressof(*__bm1), _VSTD::move(*__b));
             --__base::__start_;
             ++__base::size();
             if (__pos > 1)
-                __b = _VSTD::move(_VSTD::next(__b), __b + __pos, __b);
-            *__b = _VSTD::move(__tmp.get());
+                __b = __move_and_check(_VSTD::next(__b), __b + __pos, __b, __vt);
+            *__b = *__vt;
         }
     }
     else
@@ -2063,27 +2040,26 @@ deque<_Tp, _Allocator>::emplace(const_it
         size_type __de = __base::size() - __pos;
         if (__de == 0)
         {
-            __alloc_traits::construct(__a, _VSTD::addressof(*__base::end()), _VSTD::forward<_Args>(__args)...);
+            __alloc_traits::construct(__a, _VSTD::addressof(*__base::end()), __v);
             ++__base::size();
         }
         else
         {
-            __temp_value<value_type, _Allocator> __tmp(this->__alloc(), _VSTD::forward<_Args>(__args)...);
+            const_pointer __vt = pointer_traits<const_pointer>::pointer_to(__v);
             iterator __e = __base::end();
             iterator __em1 = _VSTD::prev(__e);
+            if (__vt == pointer_traits<const_pointer>::pointer_to(*__em1))
+                __vt = pointer_traits<const_pointer>::pointer_to(*__e);
             __alloc_traits::construct(__a, _VSTD::addressof(*__e), _VSTD::move(*__em1));
             ++__base::size();
             if (__de > 1)
-                __e = _VSTD::move_backward(__e - __de, __em1, __e);
-            *--__e = _VSTD::move(__tmp.get());
+                __e = __move_backward_and_check(__e - __de, __em1, __e, __vt);
+            *--__e = *__vt;
         }
     }
     return __base::begin() + __pos;
 }
 
-#endif  // _LIBCPP_HAS_NO_VARIADICS
-#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
 template <class _Tp, class _Allocator>
 typename deque<_Tp, _Allocator>::iterator
 deque<_Tp, _Allocator>::insert(const_iterator __p, size_type __n, const value_type& __v)

Modified: libcxx/trunk/test/std/containers/sequences/deque/deque.cons/assign_initializer_list.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/deque/deque.cons/assign_initializer_list.pass.cpp?rev=300413&r1=300412&r2=300413&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/deque/deque.cons/assign_initializer_list.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/deque/deque.cons/assign_initializer_list.pass.cpp Sat Apr 15 22:17:01 2017
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+// UNSUPPORTED: c++98, c++03
+
 // <deque>
 
 // void assign(initializer_list<value_type> il);
@@ -18,7 +20,6 @@
 
 int main()
 {
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
     std::deque<int> d;
     d.assign({3, 4, 5, 6});
@@ -28,7 +29,6 @@ int main()
     assert(d[2] == 5);
     assert(d[3] == 6);
     }
-#if TEST_STD_VER >= 11
     {
     std::deque<int, min_allocator<int>> d;
     d.assign({3, 4, 5, 6});
@@ -38,6 +38,4 @@ int main()
     assert(d[2] == 5);
     assert(d[3] == 6);
     }
-#endif
-#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }

Modified: libcxx/trunk/test/std/containers/sequences/deque/deque.cons/initializer_list.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/deque/deque.cons/initializer_list.pass.cpp?rev=300413&r1=300412&r2=300413&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/deque/deque.cons/initializer_list.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/deque/deque.cons/initializer_list.pass.cpp Sat Apr 15 22:17:01 2017
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+// UNSUPPORTED: c++98, c++03
+
 // <deque>
 
 // deque(initializer_list<value_type> il);
@@ -18,7 +20,6 @@
 
 int main()
 {
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
     std::deque<int> d = {3, 4, 5, 6};
     assert(d.size() == 4);
@@ -27,7 +28,6 @@ int main()
     assert(d[2] == 5);
     assert(d[3] == 6);
     }
-#if TEST_STD_VER >= 11
     {
     std::deque<int, min_allocator<int>> d = {3, 4, 5, 6};
     assert(d.size() == 4);
@@ -36,6 +36,4 @@ int main()
     assert(d[2] == 5);
     assert(d[3] == 6);
     }
-#endif
-#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }

Modified: libcxx/trunk/test/std/containers/sequences/deque/deque.cons/initializer_list_alloc.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/deque/deque.cons/initializer_list_alloc.pass.cpp?rev=300413&r1=300412&r2=300413&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/deque/deque.cons/initializer_list_alloc.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/deque/deque.cons/initializer_list_alloc.pass.cpp Sat Apr 15 22:17:01 2017
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+// UNSUPPORTED: c++98, c++03
+
 // <deque>
 
 // deque(initializer_list<value_type> il, const Allocator& a = allocator_type());
@@ -19,7 +21,6 @@
 
 int main()
 {
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
     std::deque<int, test_allocator<int>> d({3, 4, 5, 6}, test_allocator<int>(3));
     assert(d.get_allocator() == test_allocator<int>(3));
@@ -29,7 +30,6 @@ int main()
     assert(d[2] == 5);
     assert(d[3] == 6);
     }
-#if TEST_STD_VER >= 11
     {
     std::deque<int, min_allocator<int>> d({3, 4, 5, 6}, min_allocator<int>());
     assert(d.get_allocator() == min_allocator<int>());
@@ -39,6 +39,4 @@ int main()
     assert(d[2] == 5);
     assert(d[3] == 6);
     }
-#endif
-#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }

Modified: libcxx/trunk/test/std/containers/sequences/deque/deque.cons/move.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/deque/deque.cons/move.pass.cpp?rev=300413&r1=300412&r2=300413&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/deque/deque.cons/move.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/deque/deque.cons/move.pass.cpp Sat Apr 15 22:17:01 2017
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+// UNSUPPORTED: c++98, c++03
+
 // <deque>
 
 // deque(deque&&);
@@ -20,7 +22,6 @@
 
 int main()
 {
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45};
         int* an = ab + sizeof(ab)/sizeof(ab[0]);
@@ -51,7 +52,6 @@ int main()
         assert(c1.size() == 0);
         assert(c3.get_allocator() == c1.get_allocator());
     }
-#if TEST_STD_VER >= 11
     {
         int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45};
         int* an = ab + sizeof(ab)/sizeof(ab[0]);
@@ -67,6 +67,4 @@ int main()
         assert(c1.size() == 0);
         assert(c3.get_allocator() == c1.get_allocator());
     }
-#endif
-#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }

Modified: libcxx/trunk/test/std/containers/sequences/deque/deque.cons/move_alloc.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/deque/deque.cons/move_alloc.pass.cpp?rev=300413&r1=300412&r2=300413&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/deque/deque.cons/move_alloc.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/deque/deque.cons/move_alloc.pass.cpp Sat Apr 15 22:17:01 2017
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+// UNSUPPORTED: c++98, c++03
+
 // <deque>
 
 // deque(deque&& c, const allocator_type& a);
@@ -20,7 +22,6 @@
 
 int main()
 {
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45};
         int* an = ab + sizeof(ab)/sizeof(ab[0]);
@@ -66,7 +67,6 @@ int main()
         assert(c3.get_allocator() == A(3));
         assert(c1.size() != 0);
     }
-#if TEST_STD_VER >= 11
     {
         int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45};
         int* an = ab + sizeof(ab)/sizeof(ab[0]);
@@ -82,6 +82,4 @@ int main()
         assert(c3.get_allocator() == A());
         assert(c1.size() == 0);
     }
-#endif
-#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }

Modified: libcxx/trunk/test/std/containers/sequences/deque/deque.cons/move_assign.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/deque/deque.cons/move_assign.pass.cpp?rev=300413&r1=300412&r2=300413&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/deque/deque.cons/move_assign.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/deque/deque.cons/move_assign.pass.cpp Sat Apr 15 22:17:01 2017
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+// UNSUPPORTED: c++98, c++03
+
 // <deque>
 
 // deque& operator=(deque&& c);
@@ -20,7 +22,6 @@
 
 int main()
 {
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45};
         int* an = ab + sizeof(ab)/sizeof(ab[0]);
@@ -69,7 +70,6 @@ int main()
         assert(c1.size() == 0);
         assert(c3.get_allocator() == A(5));
     }
-#if TEST_STD_VER >= 11
     {
         int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45};
         int* an = ab + sizeof(ab)/sizeof(ab[0]);
@@ -86,6 +86,4 @@ int main()
         assert(c1.size() == 0);
         assert(c3.get_allocator() == A());
     }
-#endif
-#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }

Modified: libcxx/trunk/test/std/containers/sequences/deque/deque.cons/op_equal_initializer_list.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/deque/deque.cons/op_equal_initializer_list.pass.cpp?rev=300413&r1=300412&r2=300413&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/deque/deque.cons/op_equal_initializer_list.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/deque/deque.cons/op_equal_initializer_list.pass.cpp Sat Apr 15 22:17:01 2017
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+// UNSUPPORTED: c++98, c++03
+
 // <deque>
 
 // deque& operator=(initializer_list<value_type> il);
@@ -18,7 +20,6 @@
 
 int main()
 {
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
     std::deque<int> d;
     d = {3, 4, 5, 6};
@@ -28,7 +29,6 @@ int main()
     assert(d[2] == 5);
     assert(d[3] == 6);
     }
-#if TEST_STD_VER >= 11
     {
     std::deque<int, min_allocator<int>> d;
     d = {3, 4, 5, 6};
@@ -38,6 +38,4 @@ int main()
     assert(d[2] == 5);
     assert(d[3] == 6);
     }
-#endif
-#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }

Modified: libcxx/trunk/test/std/containers/sequences/deque/deque.modifiers/insert_iter_initializer_list.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/deque/deque.modifiers/insert_iter_initializer_list.pass.cpp?rev=300413&r1=300412&r2=300413&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/deque/deque.modifiers/insert_iter_initializer_list.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/deque/deque.modifiers/insert_iter_initializer_list.pass.cpp Sat Apr 15 22:17:01 2017
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+// UNSUPPORTED: c++98, c++03
+
 // <deque>
 
 // iterator insert(const_iterator p, initializer_list<value_type> il);
@@ -18,7 +20,6 @@
 
 int main()
 {
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
     std::deque<int> d(10, 1);
     std::deque<int>::iterator i = d.insert(d.cbegin() + 2, {3, 4, 5, 6});
@@ -59,5 +60,4 @@ int main()
     assert(d[12] == 1);
     assert(d[13] == 1);
     }
-#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }

Modified: libcxx/trunk/test/std/containers/sequences/deque/deque.modifiers/push_back_rvalue.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/deque/deque.modifiers/push_back_rvalue.pass.cpp?rev=300413&r1=300412&r2=300413&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/deque/deque.modifiers/push_back_rvalue.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/deque/deque.modifiers/push_back_rvalue.pass.cpp Sat Apr 15 22:17:01 2017
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+// UNSUPPORTED: c++98, c++03
+
 // <deque>
 
 // void push_back(value_type&& v);
@@ -19,7 +21,6 @@
 #include "MoveOnly.h"
 #include "min_allocator.h"
 
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class C>
 C
@@ -57,24 +58,19 @@ void test(int size)
     }
 }
 
-#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 int main()
 {
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
     int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2046, 2047, 2048, 2049, 4094, 4095, 4096};
     const int N = sizeof(rng)/sizeof(rng[0]);
     for (int j = 0; j < N; ++j)
         test<std::deque<MoveOnly> >(rng[j]);
     }
-#if TEST_STD_VER >= 11
     {
     int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2046, 2047, 2048, 2049, 4094, 4095, 4096};
     const int N = sizeof(rng)/sizeof(rng[0]);
     for (int j = 0; j < N; ++j)
         test<std::deque<MoveOnly, min_allocator<MoveOnly>> >(rng[j]);
     }
-#endif
-#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }

Modified: libcxx/trunk/test/std/containers/sequences/deque/deque.modifiers/push_front_rvalue.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/deque/deque.modifiers/push_front_rvalue.pass.cpp?rev=300413&r1=300412&r2=300413&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/deque/deque.modifiers/push_front_rvalue.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/deque/deque.modifiers/push_front_rvalue.pass.cpp Sat Apr 15 22:17:01 2017
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+// UNSUPPORTED: c++98, c++03
+
 // <deque>
 
 // void push_front(value_type&& v);
@@ -18,7 +20,6 @@
 #include "MoveOnly.h"
 #include "min_allocator.h"
 
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class C>
 C
@@ -66,11 +67,9 @@ testN(int start, int N)
     test(c1, -10);
 }
 
-#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 int main()
 {
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
     int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
     const int N = sizeof(rng)/sizeof(rng[0]);
@@ -78,7 +77,6 @@ int main()
         for (int j = 0; j < N; ++j)
             testN<std::deque<MoveOnly> >(rng[i], rng[j]);
     }
-#if TEST_STD_VER >= 11
     {
     int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
     const int N = sizeof(rng)/sizeof(rng[0]);
@@ -86,6 +84,4 @@ int main()
         for (int j = 0; j < N; ++j)
             testN<std::deque<MoveOnly, min_allocator<MoveOnly>> >(rng[i], rng[j]);
     }
-#endif
-#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }




More information about the cfe-commits mailing list