[libcxx] r189399 - LWG Issue 2162: mark allocator_traits::maxsize as noexcept
Marshall Clow
mclow.lists at gmail.com
Tue Aug 27 13:22:15 PDT 2013
Author: marshall
Date: Tue Aug 27 15:22:15 2013
New Revision: 189399
URL: http://llvm.org/viewvc/llvm-project?rev=189399&view=rev
Log:
LWG Issue 2162: mark allocator_traits::maxsize as noexcept
Modified:
libcxx/trunk/include/memory
libcxx/trunk/test/utilities/memory/allocator.traits/allocator.traits.members/max_size.pass.cpp
libcxx/trunk/www/cxx1y_status.html
Modified: libcxx/trunk/include/memory
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/memory?rev=189399&r1=189398&r2=189399&view=diff
==============================================================================
--- libcxx/trunk/include/memory (original)
+++ libcxx/trunk/include/memory Tue Aug 27 15:22:15 2013
@@ -90,7 +90,7 @@ struct allocator_traits
template <class T>
static void destroy(allocator_type& a, T* p);
- static size_type max_size(const allocator_type& a);
+ static size_type max_size(const allocator_type& a); // noexcept in C++14
static allocator_type
select_on_container_copy_construction(const allocator_type& a);
@@ -1483,7 +1483,7 @@ struct _LIBCPP_TYPE_VIS_ONLY allocator_t
{__destroy(__has_destroy<allocator_type, _Tp*>(), __a, __p);}
_LIBCPP_INLINE_VISIBILITY
- static size_type max_size(const allocator_type& __a)
+ static size_type max_size(const allocator_type& __a) _NOEXCEPT
{return __max_size(__has_max_size<const allocator_type>(), __a);}
_LIBCPP_INLINE_VISIBILITY
Modified: libcxx/trunk/test/utilities/memory/allocator.traits/allocator.traits.members/max_size.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/memory/allocator.traits/allocator.traits.members/max_size.pass.cpp?rev=189399&r1=189398&r2=189399&view=diff
==============================================================================
--- libcxx/trunk/test/utilities/memory/allocator.traits/allocator.traits.members/max_size.pass.cpp (original)
+++ libcxx/trunk/test/utilities/memory/allocator.traits/allocator.traits.members/max_size.pass.cpp Tue Aug 27 15:22:15 2013
@@ -12,7 +12,7 @@
// template <class Alloc>
// struct allocator_traits
// {
-// static size_type max_size(const allocator_type& a);
+// static size_type max_size(const allocator_type& a) noexcept;
// ...
// };
@@ -61,4 +61,10 @@ int main()
const B<int> b = {};
assert(std::allocator_traits<B<int> >::max_size(b) == 100);
}
+#if __cplusplus >= 201103
+ {
+ std::allocator<int> a;
+ static_assert(noexcept(std::allocator_traits<std::allocator<int>>::max_size(a)) == true, "");
+ }
+#endif
}
Modified: libcxx/trunk/www/cxx1y_status.html
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/www/cxx1y_status.html?rev=189399&r1=189398&r2=189399&view=diff
==============================================================================
--- libcxx/trunk/www/cxx1y_status.html (original)
+++ libcxx/trunk/www/cxx1y_status.html Tue Aug 27 15:22:15 2013
@@ -148,7 +148,7 @@
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2148">2148</a></td><td>Hashing enums should be supported directly by std::hash</td><td>Bristol</td><td></td></tr>
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2149">2149</a></td><td>Concerns about 20.8/5</td><td>Bristol</td><td></td></tr>
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2162">2162</a></td><td>allocator_traits::max_size missing noexcept</td><td>Bristol</td><td></td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2163">2163</a></td><td>nth_element requires inconsistent post-conditions</td><td>Bristol</td><td></td></tr>
+ <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2163">2163</a></td><td>nth_element requires inconsistent post-conditions</td><td>Bristol</td><td>Complete</td></tr>
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2169">2169</a></td><td>Missing reset() requirements in unique_ptr specialization</td><td>Bristol</td><td></td></tr>
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2172">2172</a></td><td>Does atomic_compare_exchange_* accept v == nullptr arguments?</td><td>Bristol</td><td></td></tr>
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2080">2080</a></td><td>Specify when once_flag becomes invalid</td><td>Bristol</td><td></td></tr>
More information about the cfe-commits
mailing list