[cfe-commits] [libcxx] r132640 - in /libcxx/trunk: include/ test/containers/associative/map/map.cons/ test/containers/associative/map/map.special/ test/containers/associative/multimap/multimap.cons/ test/containers/associative/multimap/multimap.special/ test/containers/associative/multiset/multiset.cons/ test/containers/associative/multiset/multiset.special/ test/containers/associative/set/set.cons/ test/containers/associative/set/set.special/

Howard Hinnant hhinnant at apple.com
Sat Jun 4 08:22:34 PDT 2011


Author: hhinnant
Date: Sat Jun  4 10:22:34 2011
New Revision: 132640

URL: http://llvm.org/viewvc/llvm-project?rev=132640&view=rev
Log:
noexcept for <set>.  Plus a few fixes to noexcept for <map>.

Added:
    libcxx/trunk/test/containers/associative/multiset/multiset.cons/default_noexcept.pass.cpp
    libcxx/trunk/test/containers/associative/multiset/multiset.cons/dtor_noexcept.pass.cpp
    libcxx/trunk/test/containers/associative/multiset/multiset.cons/move_assign_noexcept.pass.cpp
    libcxx/trunk/test/containers/associative/multiset/multiset.cons/move_noexcept.pass.cpp
    libcxx/trunk/test/containers/associative/multiset/multiset.special/swap_noexcept.pass.cpp
    libcxx/trunk/test/containers/associative/set/set.cons/default_noexcept.pass.cpp
    libcxx/trunk/test/containers/associative/set/set.cons/dtor_noexcept.pass.cpp
    libcxx/trunk/test/containers/associative/set/set.cons/move_assign_noexcept.pass.cpp
    libcxx/trunk/test/containers/associative/set/set.cons/move_noexcept.pass.cpp
    libcxx/trunk/test/containers/associative/set/set.special/swap_noexcept.pass.cpp
Modified:
    libcxx/trunk/include/map
    libcxx/trunk/include/set
    libcxx/trunk/test/containers/associative/map/map.cons/default_noexcept.pass.cpp
    libcxx/trunk/test/containers/associative/map/map.cons/dtor_noexcept.pass.cpp
    libcxx/trunk/test/containers/associative/map/map.cons/move_assign_noexcept.pass.cpp
    libcxx/trunk/test/containers/associative/map/map.cons/move_noexcept.pass.cpp
    libcxx/trunk/test/containers/associative/map/map.special/swap_noexcept.pass.cpp
    libcxx/trunk/test/containers/associative/multimap/multimap.cons/default_noexcept.pass.cpp
    libcxx/trunk/test/containers/associative/multimap/multimap.cons/dtor_noexcept.pass.cpp
    libcxx/trunk/test/containers/associative/multimap/multimap.cons/move_assign_noexcept.pass.cpp
    libcxx/trunk/test/containers/associative/multimap/multimap.cons/move_noexcept.pass.cpp
    libcxx/trunk/test/containers/associative/multimap/multimap.special/swap_noexcept.pass.cpp
    libcxx/trunk/test/containers/associative/set/set.special/non_member_swap.pass.cpp

Modified: libcxx/trunk/include/map
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/map?rev=132640&r1=132639&r2=132640&view=diff
==============================================================================
--- libcxx/trunk/include/map (original)
+++ libcxx/trunk/include/map Sat Jun  4 10:22:34 2011
@@ -84,29 +84,29 @@
         noexcept(
             allocator_type::propagate_on_container_move_assignment::value &&
             is_nothrow_move_assignable<allocator_type>::value &&
-            is_nothrow_move_assignable<keycompare>::value);
+            is_nothrow_move_assignable<key_compare>::value);
     map& operator=(initializer_list<value_type> il);
 
     // iterators:
-          iterator begin();
-    const_iterator begin() const;
-          iterator end();
-    const_iterator end()   const;
-
-          reverse_iterator rbegin();
-    const_reverse_iterator rbegin() const;
-          reverse_iterator rend();
-    const_reverse_iterator rend()   const;
-
-    const_iterator         cbegin()  const;
-    const_iterator         cend()    const;
-    const_reverse_iterator crbegin() const;
-    const_reverse_iterator crend()   const;
+          iterator begin() noexcept;
+    const_iterator begin() const noexcept;
+          iterator end() noexcept;
+    const_iterator end()   const noexcept;
+
+          reverse_iterator rbegin() noexcept;
+    const_reverse_iterator rbegin() const noexcept;
+          reverse_iterator rend() noexcept;
+    const_reverse_iterator rend()   const noexcept;
+
+    const_iterator         cbegin()  const noexcept;
+    const_iterator         cend()    const noexcept;
+    const_reverse_iterator crbegin() const noexcept;
+    const_reverse_iterator crend()   const noexcept;
 
     // capacity:
-    bool      empty()    const;
-    size_type size()     const;
-    size_type max_size() const;
+    bool      empty()    const noexcept;
+    size_type size()     const noexcept;
+    size_type max_size() const noexcept;
 
     // element access:
     mapped_type& operator[](const key_type& k);
@@ -133,7 +133,7 @@
     iterator  erase(const_iterator position);
     size_type erase(const key_type& k);
     iterator  erase(const_iterator first, const_iterator last);
-    void clear();
+    void clear() noexcept;
 
     void swap(map& m)
         noexcept(
@@ -142,7 +142,7 @@
              __is_nothrow_swappable<allocator_type>::value));
 
     // observers:
-    allocator_type get_allocator() const;
+    allocator_type get_allocator() const noexcept;
     key_compare    key_comp()      const;
     value_compare  value_comp()    const;
 
@@ -259,29 +259,29 @@
         noexcept(
             allocator_type::propagate_on_container_move_assignment::value &&
             is_nothrow_move_assignable<allocator_type>::value &&
-            is_nothrow_move_assignable<keycompare>::value);
+            is_nothrow_move_assignable<key_compare>::value);
     multimap& operator=(initializer_list<value_type> il);
 
     // iterators:
-          iterator begin();
-    const_iterator begin() const;
-          iterator end();
-    const_iterator end()   const;
-
-          reverse_iterator rbegin();
-    const_reverse_iterator rbegin() const;
-          reverse_iterator rend();
-    const_reverse_iterator rend()   const;
-
-    const_iterator         cbegin()  const;
-    const_iterator         cend()    const;
-    const_reverse_iterator crbegin() const;
-    const_reverse_iterator crend()   const;
+          iterator begin() noexcept;
+    const_iterator begin() const noexcept;
+          iterator end() noexcept;
+    const_iterator end()   const noexcept;
+
+          reverse_iterator rbegin() noexcept;
+    const_reverse_iterator rbegin() const noexcept;
+          reverse_iterator rend() noexcept;
+    const_reverse_iterator rend()   const noexcept;
+
+    const_iterator         cbegin()  const noexcept;
+    const_iterator         cend()    const noexcept;
+    const_reverse_iterator crbegin() const noexcept;
+    const_reverse_iterator crend()   const noexcept;
 
     // capacity:
-    bool      empty()    const;
-    size_type size()     const;
-    size_type max_size() const;
+    bool      empty()    const noexcept;
+    size_type size()     const noexcept;
+    size_type max_size() const noexcept;
 
     // modifiers:
     template <class... Args>
@@ -301,7 +301,7 @@
     iterator  erase(const_iterator position);
     size_type erase(const key_type& k);
     iterator  erase(const_iterator first, const_iterator last);
-    void clear();
+    void clear() noexcept;
 
     void swap(multimap& m)
         noexcept(
@@ -310,7 +310,7 @@
              __is_nothrow_swappable<allocator_type>::value));
 
     // observers:
-    allocator_type get_allocator() const;
+    allocator_type get_allocator() const noexcept;
     key_compare    key_comp()      const;
     value_compare  value_comp()    const;
 

Modified: libcxx/trunk/include/set
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/set?rev=132640&r1=132639&r2=132640&view=diff
==============================================================================
--- libcxx/trunk/include/set (original)
+++ libcxx/trunk/include/set Sat Jun  4 10:22:34 2011
@@ -42,7 +42,12 @@
     typedef std::reverse_iterator<const_iterator>    const_reverse_iterator;
 
     // construct/copy/destroy:
-    explicit set(const value_compare& comp = value_compare());
+    set()
+        noexcept(
+            is_nothrow_default_constructible<allocator_type>::value &&
+            is_nothrow_default_constructible<key_compare>::value &&
+            is_nothrow_copy_constructible<key_compare>::value);
+    explicit set(const value_compare& comp);
     set(const value_compare& comp, const allocator_type& a);
     template <class InputIterator>
         set(InputIterator first, InputIterator last,
@@ -51,7 +56,10 @@
         set(InputIterator first, InputIterator last, const value_compare& comp,
             const allocator_type& a);
     set(const set& s);
-    set(set&& s);
+    set(set&& s)
+        noexcept(
+            is_nothrow_move_constructible<allocator_type>::value &&
+            is_nothrow_move_constructible<key_compare>::value);
     explicit set(const allocator_type& a);
     set(const set& s, const allocator_type& a);
     set(set&& s, const allocator_type& a);
@@ -61,29 +69,33 @@
     ~set();
 
     set& operator=(const set& s);
-    set& operator=(set&& s);
+    set& operator=(set&& s)
+        noexcept(
+            allocator_type::propagate_on_container_move_assignment::value &&
+            is_nothrow_move_assignable<allocator_type>::value &&
+            is_nothrow_move_assignable<key_compare>::value);
     set& operator=(initializer_list<value_type> il);
 
     // iterators:
-          iterator begin();
-    const_iterator begin() const;
-          iterator end();
-    const_iterator end()   const;
-
-          reverse_iterator rbegin();
-    const_reverse_iterator rbegin() const;
-          reverse_iterator rend();
-    const_reverse_iterator rend()   const;
-
-    const_iterator         cbegin()  const;
-    const_iterator         cend()    const;
-    const_reverse_iterator crbegin() const;
-    const_reverse_iterator crend()   const;
+          iterator begin() noexcept;
+    const_iterator begin() const noexcept;
+          iterator end() noexcept;
+    const_iterator end()   const noexcept;
+
+          reverse_iterator rbegin() noexcept;
+    const_reverse_iterator rbegin() const noexcept;
+          reverse_iterator rend() noexcept;
+    const_reverse_iterator rend()   const noexcept;
+
+    const_iterator         cbegin()  const noexcept;
+    const_iterator         cend()    const noexcept;
+    const_reverse_iterator crbegin() const noexcept;
+    const_reverse_iterator crend()   const noexcept;
 
     // capacity:
-    bool      empty()    const;
-    size_type size()     const;
-    size_type max_size() const;
+    bool      empty()    const noexcept;
+    size_type size()     const noexcept;
+    size_type max_size() const noexcept;
 
     // modifiers:
     template <class... Args>
@@ -101,12 +113,16 @@
     iterator  erase(const_iterator position);
     size_type erase(const key_type& k);
     iterator  erase(const_iterator first, const_iterator last);
-    void clear();
+    void clear() noexcept;
 
-    void swap(set& s);
+    void swap(set& s)
+        noexcept(
+            __is_nothrow_swappable<key_compare>::value &&
+            (!allocator_type::propagate_on_container_swap::value ||
+             __is_nothrow_swappable<allocator_type>::value));
 
     // observers:
-    allocator_type get_allocator() const;
+    allocator_type get_allocator() const noexcept;
     key_compare    key_comp()      const;
     value_compare  value_comp()    const;
 
@@ -155,7 +171,8 @@
 // specialized algorithms:
 template <class Key, class Compare, class Allocator>
 void
-swap(set<Key, Compare, Allocator>& x, set<Key, Compare, Allocator>& y);
+swap(set<Key, Compare, Allocator>& x, set<Key, Compare, Allocator>& y)
+    noexcept(noexcept(x.swap(y)));
 
 template <class Key, class Compare = less<Key>,
           class Allocator = allocator<Key>>
@@ -181,7 +198,12 @@
     typedef std::reverse_iterator<const_iterator>    const_reverse_iterator;
 
     // construct/copy/destroy:
-    explicit multiset(const value_compare& comp = value_compare());
+    multiset()
+        noexcept(
+            is_nothrow_default_constructible<allocator_type>::value &&
+            is_nothrow_default_constructible<key_compare>::value &&
+            is_nothrow_copy_constructible<key_compare>::value);
+    explicit multiset(const value_compare& comp);
     multiset(const value_compare& comp, const allocator_type& a);
     template <class InputIterator>
         multiset(InputIterator first, InputIterator last,
@@ -190,7 +212,10 @@
         multiset(InputIterator first, InputIterator last,
                  const value_compare& comp, const allocator_type& a);
     multiset(const multiset& s);
-    multiset(multiset&& s);
+    multiset(multiset&& s)
+        noexcept(
+            is_nothrow_move_constructible<allocator_type>::value &&
+            is_nothrow_move_constructible<key_compare>::value);
     explicit multiset(const allocator_type& a);
     multiset(const multiset& s, const allocator_type& a);
     multiset(multiset&& s, const allocator_type& a);
@@ -200,29 +225,33 @@
     ~multiset();
 
     multiset& operator=(const multiset& s);
-    multiset& operator=(multiset&& s);
+    multiset& operator=(multiset&& s)
+        noexcept(
+            allocator_type::propagate_on_container_move_assignment::value &&
+            is_nothrow_move_assignable<allocator_type>::value &&
+            is_nothrow_move_assignable<key_compare>::value);
     multiset& operator=(initializer_list<value_type> il);
 
     // iterators:
-          iterator begin();
-    const_iterator begin() const;
-          iterator end();
-    const_iterator end()   const;
-
-          reverse_iterator rbegin();
-    const_reverse_iterator rbegin() const;
-          reverse_iterator rend();
-    const_reverse_iterator rend()   const;
-
-    const_iterator         cbegin()  const;
-    const_iterator         cend()    const;
-    const_reverse_iterator crbegin() const;
-    const_reverse_iterator crend()   const;
+          iterator begin() noexcept;
+    const_iterator begin() const noexcept;
+          iterator end() noexcept;
+    const_iterator end()   const noexcept;
+
+          reverse_iterator rbegin() noexcept;
+    const_reverse_iterator rbegin() const noexcept;
+          reverse_iterator rend() noexcept;
+    const_reverse_iterator rend()   const noexcept;
+
+    const_iterator         cbegin()  const noexcept;
+    const_iterator         cend()    const noexcept;
+    const_reverse_iterator crbegin() const noexcept;
+    const_reverse_iterator crend()   const noexcept;
 
     // capacity:
-    bool      empty()    const;
-    size_type size()     const;
-    size_type max_size() const;
+    bool      empty()    const noexcept;
+    size_type size()     const noexcept;
+    size_type max_size() const noexcept;
 
     // modifiers:
     template <class... Args>
@@ -240,12 +269,16 @@
     iterator  erase(const_iterator position);
     size_type erase(const key_type& k);
     iterator  erase(const_iterator first, const_iterator last);
-    void clear();
+    void clear() noexcept;
 
-    void swap(multiset& s);
+    void swap(multiset& s)
+        noexcept(
+            __is_nothrow_swappable<key_compare>::value &&
+            (!allocator_type::propagate_on_container_swap::value ||
+             __is_nothrow_swappable<allocator_type>::value));
 
     // observers:
-    allocator_type get_allocator() const;
+    allocator_type get_allocator() const noexcept;
     key_compare    key_comp()      const;
     value_compare  value_comp()    const;
 
@@ -294,7 +327,8 @@
 // specialized algorithms:
 template <class Key, class Compare, class Allocator>
 void
-swap(multiset<Key, Compare, Allocator>& x, multiset<Key, Compare, Allocator>& y);
+swap(multiset<Key, Compare, Allocator>& x, multiset<Key, Compare, Allocator>& y)
+    noexcept(noexcept(x.swap(y)));
 
 }  // std
 
@@ -341,6 +375,10 @@
 
     _LIBCPP_INLINE_VISIBILITY
     explicit set(const value_compare& __comp = value_compare())
+        _NOEXCEPT_(
+            is_nothrow_default_constructible<allocator_type>::value &&
+            is_nothrow_default_constructible<key_compare>::value &&
+            is_nothrow_copy_constructible<key_compare>::value)
         : __tree_(__comp) {}
     _LIBCPP_INLINE_VISIBILITY
     set(const value_compare& __comp, const allocator_type& __a)
@@ -373,6 +411,7 @@
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     set(set&& __s)
+        _NOEXCEPT_(is_nothrow_move_constructible<__base>::value)
         : __tree_(_STD::move(__s.__tree_)) {}
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
@@ -416,6 +455,7 @@
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     set& operator=(set&& __s)
+        _NOEXCEPT_(is_nothrow_move_assignable<__base>::value)
         {
             __tree_ = _STD::move(__s.__tree_);
             return *this;
@@ -423,38 +463,42 @@
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     _LIBCPP_INLINE_VISIBILITY
-          iterator begin()       {return __tree_.begin();}
+          iterator begin() _NOEXCEPT       {return __tree_.begin();}
     _LIBCPP_INLINE_VISIBILITY
-    const_iterator begin() const {return __tree_.begin();}
+    const_iterator begin() const _NOEXCEPT {return __tree_.begin();}
     _LIBCPP_INLINE_VISIBILITY
-          iterator end()         {return __tree_.end();}
+          iterator end() _NOEXCEPT         {return __tree_.end();}
     _LIBCPP_INLINE_VISIBILITY
-    const_iterator end()   const {return __tree_.end();}
+    const_iterator end()   const _NOEXCEPT {return __tree_.end();}
 
     _LIBCPP_INLINE_VISIBILITY
-          reverse_iterator rbegin()       {return       reverse_iterator(end());}
+          reverse_iterator rbegin() _NOEXCEPT
+            {return reverse_iterator(end());}
     _LIBCPP_INLINE_VISIBILITY
-    const_reverse_iterator rbegin() const {return const_reverse_iterator(end());}
+    const_reverse_iterator rbegin() const _NOEXCEPT
+        {return const_reverse_iterator(end());}
     _LIBCPP_INLINE_VISIBILITY
-          reverse_iterator rend()         {return       reverse_iterator(begin());}
+          reverse_iterator rend() _NOEXCEPT
+            {return reverse_iterator(begin());}
     _LIBCPP_INLINE_VISIBILITY
-    const_reverse_iterator rend()   const {return const_reverse_iterator(begin());}
+    const_reverse_iterator rend() const _NOEXCEPT
+        {return const_reverse_iterator(begin());}
 
     _LIBCPP_INLINE_VISIBILITY
-    const_iterator         cbegin()  const {return begin();}
+    const_iterator cbegin()  const _NOEXCEPT {return begin();}
     _LIBCPP_INLINE_VISIBILITY
-    const_iterator         cend()    const {return end();}
+    const_iterator cend() const _NOEXCEPT {return end();}
     _LIBCPP_INLINE_VISIBILITY
-    const_reverse_iterator crbegin() const {return rbegin();}
+    const_reverse_iterator crbegin() const _NOEXCEPT {return rbegin();}
     _LIBCPP_INLINE_VISIBILITY
-    const_reverse_iterator crend()   const {return rend();}
+    const_reverse_iterator crend() const _NOEXCEPT {return rend();}
 
     _LIBCPP_INLINE_VISIBILITY
-    bool      empty()    const {return __tree_.size() == 0;}
+    bool empty() const _NOEXCEPT {return __tree_.size() == 0;}
     _LIBCPP_INLINE_VISIBILITY
-    size_type size()     const {return __tree_.size();}
+    size_type size() const _NOEXCEPT {return __tree_.size();}
     _LIBCPP_INLINE_VISIBILITY
-    size_type max_size() const {return __tree_.max_size();}
+    size_type max_size() const _NOEXCEPT {return __tree_.max_size();}
 
     // modifiers:
 #if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
@@ -504,13 +548,14 @@
     iterator  erase(const_iterator __f, const_iterator __l)
         {return __tree_.erase(__f, __l);}
     _LIBCPP_INLINE_VISIBILITY
-    void clear() {__tree_.clear();}
+    void clear() _NOEXCEPT {__tree_.clear();}
 
     _LIBCPP_INLINE_VISIBILITY
-    void swap(set& __s) {__tree_.swap(__s.__tree_);}
+    void swap(set& __s) _NOEXCEPT_(__is_nothrow_swappable<__base>::value)
+        {__tree_.swap(__s.__tree_);}
 
     _LIBCPP_INLINE_VISIBILITY
-    allocator_type get_allocator() const {return __tree_.__alloc();}
+    allocator_type get_allocator() const _NOEXCEPT {return __tree_.__alloc();}
     _LIBCPP_INLINE_VISIBILITY
     key_compare    key_comp()      const {return __tree_.value_comp();}
     _LIBCPP_INLINE_VISIBILITY
@@ -620,6 +665,7 @@
 void
 swap(set<_Key, _Compare, _Allocator>& __x,
      set<_Key, _Compare, _Allocator>& __y)
+    _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
 {
     __x.swap(__y);
 }
@@ -658,6 +704,10 @@
     // construct/copy/destroy:
     _LIBCPP_INLINE_VISIBILITY
     explicit multiset(const value_compare& __comp = value_compare())
+        _NOEXCEPT_(
+            is_nothrow_default_constructible<allocator_type>::value &&
+            is_nothrow_default_constructible<key_compare>::value &&
+            is_nothrow_copy_constructible<key_compare>::value)
         : __tree_(__comp) {}
     _LIBCPP_INLINE_VISIBILITY
     multiset(const value_compare& __comp, const allocator_type& __a)
@@ -691,6 +741,7 @@
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     multiset(multiset&& __s)
+        _NOEXCEPT_(is_nothrow_move_constructible<__base>::value)
         : __tree_(_STD::move(__s.__tree_)) {}
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
@@ -731,6 +782,7 @@
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     multiset& operator=(multiset&& __s)
+        _NOEXCEPT_(is_nothrow_move_assignable<__base>::value)
         {
             __tree_ = _STD::move(__s.__tree_);
             return *this;
@@ -738,38 +790,42 @@
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     _LIBCPP_INLINE_VISIBILITY
-          iterator begin()       {return __tree_.begin();}
+          iterator begin() _NOEXCEPT       {return __tree_.begin();}
     _LIBCPP_INLINE_VISIBILITY
-    const_iterator begin() const {return __tree_.begin();}
+    const_iterator begin() const _NOEXCEPT {return __tree_.begin();}
     _LIBCPP_INLINE_VISIBILITY
-          iterator end()         {return __tree_.end();}
+          iterator end() _NOEXCEPT         {return __tree_.end();}
     _LIBCPP_INLINE_VISIBILITY
-    const_iterator end()   const {return __tree_.end();}
+    const_iterator end()   const _NOEXCEPT {return __tree_.end();}
 
     _LIBCPP_INLINE_VISIBILITY
-          reverse_iterator rbegin()       {return       reverse_iterator(end());}
+          reverse_iterator rbegin() _NOEXCEPT
+            {return reverse_iterator(end());}
     _LIBCPP_INLINE_VISIBILITY
-    const_reverse_iterator rbegin() const {return const_reverse_iterator(end());}
+    const_reverse_iterator rbegin() const _NOEXCEPT
+        {return const_reverse_iterator(end());}
     _LIBCPP_INLINE_VISIBILITY
-          reverse_iterator rend()         {return       reverse_iterator(begin());}
+          reverse_iterator rend() _NOEXCEPT
+            {return       reverse_iterator(begin());}
     _LIBCPP_INLINE_VISIBILITY
-    const_reverse_iterator rend()   const {return const_reverse_iterator(begin());}
+    const_reverse_iterator rend() const _NOEXCEPT
+        {return const_reverse_iterator(begin());}
 
     _LIBCPP_INLINE_VISIBILITY
-    const_iterator         cbegin()  const {return begin();}
+    const_iterator cbegin()  const _NOEXCEPT {return begin();}
     _LIBCPP_INLINE_VISIBILITY
-    const_iterator         cend()    const {return end();}
+    const_iterator cend() const _NOEXCEPT {return end();}
     _LIBCPP_INLINE_VISIBILITY
-    const_reverse_iterator crbegin() const {return rbegin();}
+    const_reverse_iterator crbegin() const _NOEXCEPT {return rbegin();}
     _LIBCPP_INLINE_VISIBILITY
-    const_reverse_iterator crend()   const {return rend();}
+    const_reverse_iterator crend() const _NOEXCEPT {return rend();}
 
     _LIBCPP_INLINE_VISIBILITY
-    bool      empty()    const {return __tree_.size() == 0;}
+    bool empty() const _NOEXCEPT {return __tree_.size() == 0;}
     _LIBCPP_INLINE_VISIBILITY
-    size_type size()     const {return __tree_.size();}
+    size_type size() const _NOEXCEPT {return __tree_.size();}
     _LIBCPP_INLINE_VISIBILITY
-    size_type max_size() const {return __tree_.max_size();}
+    size_type max_size() const _NOEXCEPT {return __tree_.max_size();}
 
     // modifiers:
 #if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
@@ -818,13 +874,15 @@
     iterator  erase(const_iterator __f, const_iterator __l)
         {return __tree_.erase(__f, __l);}
     _LIBCPP_INLINE_VISIBILITY
-    void clear() {__tree_.clear();}
+    void clear() _NOEXCEPT {__tree_.clear();}
 
     _LIBCPP_INLINE_VISIBILITY
-    void swap(multiset& __s) {__tree_.swap(__s.__tree_);}
+    void swap(multiset& __s)
+        _NOEXCEPT_(__is_nothrow_swappable<__base>::value)
+        {__tree_.swap(__s.__tree_);}
 
     _LIBCPP_INLINE_VISIBILITY
-    allocator_type get_allocator() const {return __tree_.__alloc();}
+    allocator_type get_allocator() const _NOEXCEPT {return __tree_.__alloc();}
     _LIBCPP_INLINE_VISIBILITY
     key_compare    key_comp()      const {return __tree_.value_comp();}
     _LIBCPP_INLINE_VISIBILITY
@@ -933,6 +991,7 @@
 void
 swap(multiset<_Key, _Compare, _Allocator>& __x,
      multiset<_Key, _Compare, _Allocator>& __y)
+    _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
 {
     __x.swap(__y);
 }

Modified: libcxx/trunk/test/containers/associative/map/map.cons/default_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/associative/map/map.cons/default_noexcept.pass.cpp?rev=132640&r1=132639&r2=132640&view=diff
==============================================================================
--- libcxx/trunk/test/containers/associative/map/map.cons/default_noexcept.pass.cpp (original)
+++ libcxx/trunk/test/containers/associative/map/map.cons/default_noexcept.pass.cpp Sat Jun  4 10:22:34 2011
@@ -42,7 +42,7 @@
         static_assert(std::is_nothrow_default_constructible<C>::value, "");
     }
     {
-        typedef std::map<MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
+        typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
         static_assert(!std::is_nothrow_default_constructible<C>::value, "");
     }
     {

Modified: libcxx/trunk/test/containers/associative/map/map.cons/dtor_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/associative/map/map.cons/dtor_noexcept.pass.cpp?rev=132640&r1=132639&r2=132640&view=diff
==============================================================================
--- libcxx/trunk/test/containers/associative/map/map.cons/dtor_noexcept.pass.cpp (original)
+++ libcxx/trunk/test/containers/associative/map/map.cons/dtor_noexcept.pass.cpp Sat Jun  4 10:22:34 2011
@@ -40,7 +40,7 @@
         static_assert(std::is_nothrow_destructible<C>::value, "");
     }
     {
-        typedef std::map<MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
+        typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
         static_assert(std::is_nothrow_destructible<C>::value, "");
     }
     {

Modified: libcxx/trunk/test/containers/associative/map/map.cons/move_assign_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/associative/map/map.cons/move_assign_noexcept.pass.cpp?rev=132640&r1=132639&r2=132640&view=diff
==============================================================================
--- libcxx/trunk/test/containers/associative/map/map.cons/move_assign_noexcept.pass.cpp (original)
+++ libcxx/trunk/test/containers/associative/map/map.cons/move_assign_noexcept.pass.cpp Sat Jun  4 10:22:34 2011
@@ -42,7 +42,7 @@
         static_assert(!std::is_nothrow_move_assignable<C>::value, "");
     }
     {
-        typedef std::map<MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
+        typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
         static_assert(std::is_nothrow_move_assignable<C>::value, "");
     }
     {

Modified: libcxx/trunk/test/containers/associative/map/map.cons/move_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/associative/map/map.cons/move_noexcept.pass.cpp?rev=132640&r1=132639&r2=132640&view=diff
==============================================================================
--- libcxx/trunk/test/containers/associative/map/map.cons/move_noexcept.pass.cpp (original)
+++ libcxx/trunk/test/containers/associative/map/map.cons/move_noexcept.pass.cpp Sat Jun  4 10:22:34 2011
@@ -40,7 +40,7 @@
         static_assert(std::is_nothrow_move_constructible<C>::value, "");
     }
     {
-        typedef std::map<MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
+        typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
         static_assert(std::is_nothrow_move_constructible<C>::value, "");
     }
     {

Modified: libcxx/trunk/test/containers/associative/map/map.special/swap_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/associative/map/map.special/swap_noexcept.pass.cpp?rev=132640&r1=132639&r2=132640&view=diff
==============================================================================
--- libcxx/trunk/test/containers/associative/map/map.special/swap_noexcept.pass.cpp (original)
+++ libcxx/trunk/test/containers/associative/map/map.special/swap_noexcept.pass.cpp Sat Jun  4 10:22:34 2011
@@ -47,7 +47,7 @@
         static_assert(noexcept(swap(c1, c2)), "");
     }
     {
-        typedef std::map<MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
+        typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
         C c1, c2;
         static_assert(noexcept(swap(c1, c2)), "");
     }

Modified: libcxx/trunk/test/containers/associative/multimap/multimap.cons/default_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/associative/multimap/multimap.cons/default_noexcept.pass.cpp?rev=132640&r1=132639&r2=132640&view=diff
==============================================================================
--- libcxx/trunk/test/containers/associative/multimap/multimap.cons/default_noexcept.pass.cpp (original)
+++ libcxx/trunk/test/containers/associative/multimap/multimap.cons/default_noexcept.pass.cpp Sat Jun  4 10:22:34 2011
@@ -42,7 +42,7 @@
         static_assert(std::is_nothrow_default_constructible<C>::value, "");
     }
     {
-        typedef std::multimap<MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
+        typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
         static_assert(!std::is_nothrow_default_constructible<C>::value, "");
     }
     {

Modified: libcxx/trunk/test/containers/associative/multimap/multimap.cons/dtor_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/associative/multimap/multimap.cons/dtor_noexcept.pass.cpp?rev=132640&r1=132639&r2=132640&view=diff
==============================================================================
--- libcxx/trunk/test/containers/associative/multimap/multimap.cons/dtor_noexcept.pass.cpp (original)
+++ libcxx/trunk/test/containers/associative/multimap/multimap.cons/dtor_noexcept.pass.cpp Sat Jun  4 10:22:34 2011
@@ -40,7 +40,7 @@
         static_assert(std::is_nothrow_destructible<C>::value, "");
     }
     {
-        typedef std::multimap<MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
+        typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
         static_assert(std::is_nothrow_destructible<C>::value, "");
     }
     {

Modified: libcxx/trunk/test/containers/associative/multimap/multimap.cons/move_assign_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/associative/multimap/multimap.cons/move_assign_noexcept.pass.cpp?rev=132640&r1=132639&r2=132640&view=diff
==============================================================================
--- libcxx/trunk/test/containers/associative/multimap/multimap.cons/move_assign_noexcept.pass.cpp (original)
+++ libcxx/trunk/test/containers/associative/multimap/multimap.cons/move_assign_noexcept.pass.cpp Sat Jun  4 10:22:34 2011
@@ -42,7 +42,7 @@
         static_assert(!std::is_nothrow_move_assignable<C>::value, "");
     }
     {
-        typedef std::multimap<MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
+        typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
         static_assert(std::is_nothrow_move_assignable<C>::value, "");
     }
     {

Modified: libcxx/trunk/test/containers/associative/multimap/multimap.cons/move_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/associative/multimap/multimap.cons/move_noexcept.pass.cpp?rev=132640&r1=132639&r2=132640&view=diff
==============================================================================
--- libcxx/trunk/test/containers/associative/multimap/multimap.cons/move_noexcept.pass.cpp (original)
+++ libcxx/trunk/test/containers/associative/multimap/multimap.cons/move_noexcept.pass.cpp Sat Jun  4 10:22:34 2011
@@ -40,7 +40,7 @@
         static_assert(std::is_nothrow_move_constructible<C>::value, "");
     }
     {
-        typedef std::multimap<MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
+        typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
         static_assert(std::is_nothrow_move_constructible<C>::value, "");
     }
     {

Modified: libcxx/trunk/test/containers/associative/multimap/multimap.special/swap_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/associative/multimap/multimap.special/swap_noexcept.pass.cpp?rev=132640&r1=132639&r2=132640&view=diff
==============================================================================
--- libcxx/trunk/test/containers/associative/multimap/multimap.special/swap_noexcept.pass.cpp (original)
+++ libcxx/trunk/test/containers/associative/multimap/multimap.special/swap_noexcept.pass.cpp Sat Jun  4 10:22:34 2011
@@ -47,7 +47,7 @@
         static_assert(noexcept(swap(c1, c2)), "");
     }
     {
-        typedef std::multimap<MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
+        typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
         C c1, c2;
         static_assert(noexcept(swap(c1, c2)), "");
     }

Added: libcxx/trunk/test/containers/associative/multiset/multiset.cons/default_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/associative/multiset/multiset.cons/default_noexcept.pass.cpp?rev=132640&view=auto
==============================================================================
--- libcxx/trunk/test/containers/associative/multiset/multiset.cons/default_noexcept.pass.cpp (added)
+++ libcxx/trunk/test/containers/associative/multiset/multiset.cons/default_noexcept.pass.cpp Sat Jun  4 10:22:34 2011
@@ -0,0 +1,53 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <set>
+
+// multiset()
+//    noexcept(
+//        is_nothrow_default_constructible<allocator_type>::value &&
+//        is_nothrow_default_constructible<key_compare>::value &&
+//        is_nothrow_copy_constructible<key_compare>::value);
+
+// This tests a conforming extension
+
+#include <set>
+#include <cassert>
+
+#include "../../../MoveOnly.h"
+#include "../../../test_allocator.h"
+
+template <class T>
+struct some_comp
+{
+    typedef T value_type;
+    some_comp();
+};
+
+int main()
+{
+#if __has_feature(cxx_noexcept)
+    {
+        typedef std::multiset<MoveOnly> C;
+        static_assert(std::is_nothrow_default_constructible<C>::value, "");
+    }
+    {
+        typedef std::multiset<MoveOnly, std::less<MoveOnly>, test_allocator<MoveOnly>> C;
+        static_assert(std::is_nothrow_default_constructible<C>::value, "");
+    }
+    {
+        typedef std::multiset<MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
+        static_assert(!std::is_nothrow_default_constructible<C>::value, "");
+    }
+    {
+        typedef std::multiset<MoveOnly, some_comp<MoveOnly>> C;
+        static_assert(!std::is_nothrow_default_constructible<C>::value, "");
+    }
+#endif
+}

Added: libcxx/trunk/test/containers/associative/multiset/multiset.cons/dtor_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/associative/multiset/multiset.cons/dtor_noexcept.pass.cpp?rev=132640&view=auto
==============================================================================
--- libcxx/trunk/test/containers/associative/multiset/multiset.cons/dtor_noexcept.pass.cpp (added)
+++ libcxx/trunk/test/containers/associative/multiset/multiset.cons/dtor_noexcept.pass.cpp Sat Jun  4 10:22:34 2011
@@ -0,0 +1,51 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <set>
+
+// ~multiset() // implied noexcept;
+
+#include <set>
+#include <cassert>
+
+#include "../../../MoveOnly.h"
+#include "../../../test_allocator.h"
+
+#if __has_feature(cxx_noexcept)
+
+template <class T>
+struct some_comp
+{
+    typedef T value_type;
+    ~some_comp() noexcept(false);
+};
+
+#endif
+
+int main()
+{
+#if __has_feature(cxx_noexcept)
+    {
+        typedef std::multiset<MoveOnly> C;
+        static_assert(std::is_nothrow_destructible<C>::value, "");
+    }
+    {
+        typedef std::multiset<MoveOnly, std::less<MoveOnly>, test_allocator<MoveOnly>> C;
+        static_assert(std::is_nothrow_destructible<C>::value, "");
+    }
+    {
+        typedef std::multiset<MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
+        static_assert(std::is_nothrow_destructible<C>::value, "");
+    }
+    {
+        typedef std::multiset<MoveOnly, some_comp<MoveOnly>> C;
+        static_assert(!std::is_nothrow_destructible<C>::value, "");
+    }
+#endif
+}

Added: libcxx/trunk/test/containers/associative/multiset/multiset.cons/move_assign_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/associative/multiset/multiset.cons/move_assign_noexcept.pass.cpp?rev=132640&view=auto
==============================================================================
--- libcxx/trunk/test/containers/associative/multiset/multiset.cons/move_assign_noexcept.pass.cpp (added)
+++ libcxx/trunk/test/containers/associative/multiset/multiset.cons/move_assign_noexcept.pass.cpp Sat Jun  4 10:22:34 2011
@@ -0,0 +1,53 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <set>
+
+// multiset& operator=(multiset&& c)
+//     noexcept(
+//          allocator_type::propagate_on_container_move_assignment::value &&
+//          is_nothrow_move_assignable<allocator_type>::value &&
+//          is_nothrow_move_assignable<key_compare>::value);
+
+// This tests a conforming extension
+
+#include <set>
+#include <cassert>
+
+#include "../../../MoveOnly.h"
+#include "../../../test_allocator.h"
+
+template <class T>
+struct some_comp
+{
+    typedef T value_type;
+    some_comp& operator=(const some_comp&);
+};
+
+int main()
+{
+#if __has_feature(cxx_noexcept)
+    {
+        typedef std::multiset<MoveOnly> C;
+        static_assert(std::is_nothrow_move_assignable<C>::value, "");
+    }
+    {
+        typedef std::multiset<MoveOnly, std::less<MoveOnly>, test_allocator<MoveOnly>> C;
+        static_assert(!std::is_nothrow_move_assignable<C>::value, "");
+    }
+    {
+        typedef std::multiset<MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
+        static_assert(std::is_nothrow_move_assignable<C>::value, "");
+    }
+    {
+        typedef std::multiset<MoveOnly, some_comp<MoveOnly>> C;
+        static_assert(!std::is_nothrow_move_assignable<C>::value, "");
+    }
+#endif
+}

Added: libcxx/trunk/test/containers/associative/multiset/multiset.cons/move_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/associative/multiset/multiset.cons/move_noexcept.pass.cpp?rev=132640&view=auto
==============================================================================
--- libcxx/trunk/test/containers/associative/multiset/multiset.cons/move_noexcept.pass.cpp (added)
+++ libcxx/trunk/test/containers/associative/multiset/multiset.cons/move_noexcept.pass.cpp Sat Jun  4 10:22:34 2011
@@ -0,0 +1,51 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <set>
+
+// multiset(multiset&&)
+//        noexcept(is_nothrow_move_constructible<allocator_type>::value &&
+//                 is_nothrow_move_constructible<key_compare>::value);
+
+// This tests a conforming extension
+
+#include <set>
+#include <cassert>
+
+#include "../../../MoveOnly.h"
+#include "../../../test_allocator.h"
+
+template <class T>
+struct some_comp
+{
+    typedef T value_type;
+    some_comp(const some_comp&);
+};
+
+int main()
+{
+#if __has_feature(cxx_noexcept)
+    {
+        typedef std::multiset<MoveOnly> C;
+        static_assert(std::is_nothrow_move_constructible<C>::value, "");
+    }
+    {
+        typedef std::multiset<MoveOnly, std::less<MoveOnly>, test_allocator<MoveOnly>> C;
+        static_assert(std::is_nothrow_move_constructible<C>::value, "");
+    }
+    {
+        typedef std::multiset<MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
+        static_assert(std::is_nothrow_move_constructible<C>::value, "");
+    }
+    {
+        typedef std::multiset<MoveOnly, some_comp<MoveOnly>> C;
+        static_assert(!std::is_nothrow_move_constructible<C>::value, "");
+    }
+#endif
+}

Added: libcxx/trunk/test/containers/associative/multiset/multiset.special/swap_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/associative/multiset/multiset.special/swap_noexcept.pass.cpp?rev=132640&view=auto
==============================================================================
--- libcxx/trunk/test/containers/associative/multiset/multiset.special/swap_noexcept.pass.cpp (added)
+++ libcxx/trunk/test/containers/associative/multiset/multiset.special/swap_noexcept.pass.cpp Sat Jun  4 10:22:34 2011
@@ -0,0 +1,60 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <set>
+
+// void swap(multiset& c)
+//     noexcept(!allocator_type::propagate_on_container_swap::value ||
+//              __is_nothrow_swappable<allocator_type>::value);
+
+// This tests a conforming extension
+
+#include <set>
+#include <cassert>
+
+#include "../../../MoveOnly.h"
+#include "../../../test_allocator.h"
+
+template <class T>
+struct some_comp
+{
+    typedef T value_type;
+    
+    some_comp() {}
+    some_comp(const some_comp&) {}
+    void deallocate(void*, unsigned) {}
+
+    typedef std::true_type propagate_on_container_swap;
+};
+
+int main()
+{
+#if __has_feature(cxx_noexcept)
+    {
+        typedef std::multiset<MoveOnly> C;
+        C c1, c2;
+        static_assert(noexcept(swap(c1, c2)), "");
+    }
+    {
+        typedef std::multiset<MoveOnly, std::less<MoveOnly>, test_allocator<MoveOnly>> C;
+        C c1, c2;
+        static_assert(noexcept(swap(c1, c2)), "");
+    }
+    {
+        typedef std::multiset<MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
+        C c1, c2;
+        static_assert(noexcept(swap(c1, c2)), "");
+    }
+    {
+        typedef std::multiset<MoveOnly, some_comp<MoveOnly>> C;
+        C c1, c2;
+        static_assert(!noexcept(swap(c1, c2)), "");
+    }
+#endif
+}

Added: libcxx/trunk/test/containers/associative/set/set.cons/default_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/associative/set/set.cons/default_noexcept.pass.cpp?rev=132640&view=auto
==============================================================================
--- libcxx/trunk/test/containers/associative/set/set.cons/default_noexcept.pass.cpp (added)
+++ libcxx/trunk/test/containers/associative/set/set.cons/default_noexcept.pass.cpp Sat Jun  4 10:22:34 2011
@@ -0,0 +1,53 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <set>
+
+// set()
+//    noexcept(
+//        is_nothrow_default_constructible<allocator_type>::value &&
+//        is_nothrow_default_constructible<key_compare>::value &&
+//        is_nothrow_copy_constructible<key_compare>::value);
+
+// This tests a conforming extension
+
+#include <set>
+#include <cassert>
+
+#include "../../../MoveOnly.h"
+#include "../../../test_allocator.h"
+
+template <class T>
+struct some_comp
+{
+    typedef T value_type;
+    some_comp();
+};
+
+int main()
+{
+#if __has_feature(cxx_noexcept)
+    {
+        typedef std::set<MoveOnly> C;
+        static_assert(std::is_nothrow_default_constructible<C>::value, "");
+    }
+    {
+        typedef std::set<MoveOnly, std::less<MoveOnly>, test_allocator<MoveOnly>> C;
+        static_assert(std::is_nothrow_default_constructible<C>::value, "");
+    }
+    {
+        typedef std::set<MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
+        static_assert(!std::is_nothrow_default_constructible<C>::value, "");
+    }
+    {
+        typedef std::set<MoveOnly, some_comp<MoveOnly>> C;
+        static_assert(!std::is_nothrow_default_constructible<C>::value, "");
+    }
+#endif
+}

Added: libcxx/trunk/test/containers/associative/set/set.cons/dtor_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/associative/set/set.cons/dtor_noexcept.pass.cpp?rev=132640&view=auto
==============================================================================
--- libcxx/trunk/test/containers/associative/set/set.cons/dtor_noexcept.pass.cpp (added)
+++ libcxx/trunk/test/containers/associative/set/set.cons/dtor_noexcept.pass.cpp Sat Jun  4 10:22:34 2011
@@ -0,0 +1,51 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <set>
+
+// ~set() // implied noexcept;
+
+#include <set>
+#include <cassert>
+
+#include "../../../MoveOnly.h"
+#include "../../../test_allocator.h"
+
+#if __has_feature(cxx_noexcept)
+
+template <class T>
+struct some_comp
+{
+    typedef T value_type;
+    ~some_comp() noexcept(false);
+};
+
+#endif
+
+int main()
+{
+#if __has_feature(cxx_noexcept)
+    {
+        typedef std::set<MoveOnly> C;
+        static_assert(std::is_nothrow_destructible<C>::value, "");
+    }
+    {
+        typedef std::set<MoveOnly, std::less<MoveOnly>, test_allocator<MoveOnly>> C;
+        static_assert(std::is_nothrow_destructible<C>::value, "");
+    }
+    {
+        typedef std::set<MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
+        static_assert(std::is_nothrow_destructible<C>::value, "");
+    }
+    {
+        typedef std::set<MoveOnly, some_comp<MoveOnly>> C;
+        static_assert(!std::is_nothrow_destructible<C>::value, "");
+    }
+#endif
+}

Added: libcxx/trunk/test/containers/associative/set/set.cons/move_assign_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/associative/set/set.cons/move_assign_noexcept.pass.cpp?rev=132640&view=auto
==============================================================================
--- libcxx/trunk/test/containers/associative/set/set.cons/move_assign_noexcept.pass.cpp (added)
+++ libcxx/trunk/test/containers/associative/set/set.cons/move_assign_noexcept.pass.cpp Sat Jun  4 10:22:34 2011
@@ -0,0 +1,53 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <set>
+
+// set& operator=(set&& c)
+//     noexcept(
+//          allocator_type::propagate_on_container_move_assignment::value &&
+//          is_nothrow_move_assignable<allocator_type>::value &&
+//          is_nothrow_move_assignable<key_compare>::value);
+
+// This tests a conforming extension
+
+#include <set>
+#include <cassert>
+
+#include "../../../MoveOnly.h"
+#include "../../../test_allocator.h"
+
+template <class T>
+struct some_comp
+{
+    typedef T value_type;
+    some_comp& operator=(const some_comp&);
+};
+
+int main()
+{
+#if __has_feature(cxx_noexcept)
+    {
+        typedef std::set<MoveOnly> C;
+        static_assert(std::is_nothrow_move_assignable<C>::value, "");
+    }
+    {
+        typedef std::set<MoveOnly, std::less<MoveOnly>, test_allocator<MoveOnly>> C;
+        static_assert(!std::is_nothrow_move_assignable<C>::value, "");
+    }
+    {
+        typedef std::set<MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
+        static_assert(std::is_nothrow_move_assignable<C>::value, "");
+    }
+    {
+        typedef std::set<MoveOnly, some_comp<MoveOnly>> C;
+        static_assert(!std::is_nothrow_move_assignable<C>::value, "");
+    }
+#endif
+}

Added: libcxx/trunk/test/containers/associative/set/set.cons/move_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/associative/set/set.cons/move_noexcept.pass.cpp?rev=132640&view=auto
==============================================================================
--- libcxx/trunk/test/containers/associative/set/set.cons/move_noexcept.pass.cpp (added)
+++ libcxx/trunk/test/containers/associative/set/set.cons/move_noexcept.pass.cpp Sat Jun  4 10:22:34 2011
@@ -0,0 +1,51 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <set>
+
+// set(set&&)
+//        noexcept(is_nothrow_move_constructible<allocator_type>::value &&
+//                 is_nothrow_move_constructible<key_compare>::value);
+
+// This tests a conforming extension
+
+#include <set>
+#include <cassert>
+
+#include "../../../MoveOnly.h"
+#include "../../../test_allocator.h"
+
+template <class T>
+struct some_comp
+{
+    typedef T value_type;
+    some_comp(const some_comp&);
+};
+
+int main()
+{
+#if __has_feature(cxx_noexcept)
+    {
+        typedef std::set<MoveOnly> C;
+        static_assert(std::is_nothrow_move_constructible<C>::value, "");
+    }
+    {
+        typedef std::set<MoveOnly, std::less<MoveOnly>, test_allocator<MoveOnly>> C;
+        static_assert(std::is_nothrow_move_constructible<C>::value, "");
+    }
+    {
+        typedef std::set<MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
+        static_assert(std::is_nothrow_move_constructible<C>::value, "");
+    }
+    {
+        typedef std::set<MoveOnly, some_comp<MoveOnly>> C;
+        static_assert(!std::is_nothrow_move_constructible<C>::value, "");
+    }
+#endif
+}

Modified: libcxx/trunk/test/containers/associative/set/set.special/non_member_swap.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/associative/set/set.special/non_member_swap.pass.cpp?rev=132640&r1=132639&r2=132640&view=diff
==============================================================================
--- libcxx/trunk/test/containers/associative/set/set.special/non_member_swap.pass.cpp (original)
+++ libcxx/trunk/test/containers/associative/set/set.special/non_member_swap.pass.cpp Sat Jun  4 10:22:34 2011
@@ -109,7 +109,7 @@
     {
         typedef test_allocator<V> A;
         typedef test_compare<std::less<int> > C;
-        typedef std::multiset<int, C, A> M;
+        typedef std::set<int, C, A> M;
         V ar1[] =
         {
             1,
@@ -143,7 +143,7 @@
     {
         typedef other_allocator<V> A;
         typedef test_compare<std::less<int> > C;
-        typedef std::multiset<int, C, A> M;
+        typedef std::set<int, C, A> M;
         V ar1[] =
         {
             1,

Added: libcxx/trunk/test/containers/associative/set/set.special/swap_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/associative/set/set.special/swap_noexcept.pass.cpp?rev=132640&view=auto
==============================================================================
--- libcxx/trunk/test/containers/associative/set/set.special/swap_noexcept.pass.cpp (added)
+++ libcxx/trunk/test/containers/associative/set/set.special/swap_noexcept.pass.cpp Sat Jun  4 10:22:34 2011
@@ -0,0 +1,60 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <set>
+
+// void swap(set& c)
+//     noexcept(!allocator_type::propagate_on_container_swap::value ||
+//              __is_nothrow_swappable<allocator_type>::value);
+
+// This tests a conforming extension
+
+#include <set>
+#include <cassert>
+
+#include "../../../MoveOnly.h"
+#include "../../../test_allocator.h"
+
+template <class T>
+struct some_comp
+{
+    typedef T value_type;
+    
+    some_comp() {}
+    some_comp(const some_comp&) {}
+    void deallocate(void*, unsigned) {}
+
+    typedef std::true_type propagate_on_container_swap;
+};
+
+int main()
+{
+#if __has_feature(cxx_noexcept)
+    {
+        typedef std::set<MoveOnly> C;
+        C c1, c2;
+        static_assert(noexcept(swap(c1, c2)), "");
+    }
+    {
+        typedef std::set<MoveOnly, std::less<MoveOnly>, test_allocator<MoveOnly>> C;
+        C c1, c2;
+        static_assert(noexcept(swap(c1, c2)), "");
+    }
+    {
+        typedef std::set<MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
+        C c1, c2;
+        static_assert(noexcept(swap(c1, c2)), "");
+    }
+    {
+        typedef std::set<MoveOnly, some_comp<MoveOnly>> C;
+        C c1, c2;
+        static_assert(!noexcept(swap(c1, c2)), "");
+    }
+#endif
+}





More information about the cfe-commits mailing list