Author: marshall Date: Mon Mar 14 12:58:11 2016 New Revision: 263450 URL: http://llvm.org/viewvc/llvm-project?rev=263450&view=rev Log: Implement LWG#2566: Requirements on the first template parameter of container adaptors
Modified: libcxx/trunk/include/queue libcxx/trunk/include/stack libcxx/trunk/test/std/containers/container.adaptors/priority.queue/types.pass.cpp libcxx/trunk/test/std/containers/container.adaptors/queue/queue.defn/types.pass.cpp libcxx/trunk/test/std/containers/container.adaptors/stack/stack.defn/types.pass.cpp libcxx/trunk/www/cxx1z_status.html Modified: libcxx/trunk/include/queue URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/queue?rev=263450&r1=263449&r2=263450&view=diff ============================================================================== --- libcxx/trunk/include/queue (original) +++ libcxx/trunk/include/queue Mon Mar 14 12:58:11 2016 @@ -198,6 +198,7 @@ public: typedef typename container_type::reference reference; typedef typename container_type::const_reference const_reference; typedef typename container_type::size_type size_type; + static_assert((is_same<_Tp, value_type>::value), "" ); protected: container_type c; @@ -392,6 +393,7 @@ public: typedef typename container_type::reference reference; typedef typename container_type::const_reference const_reference; typedef typename container_type::size_type size_type; + static_assert((is_same<_Tp, value_type>::value), "" ); protected: container_type c; Modified: libcxx/trunk/include/stack URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/stack?rev=263450&r1=263449&r2=263450&view=diff ============================================================================== --- libcxx/trunk/include/stack (original) +++ libcxx/trunk/include/stack Mon Mar 14 12:58:11 2016 @@ -112,7 +112,8 @@ public: typedef typename container_type::reference reference; typedef typename container_type::const_reference const_reference; typedef typename container_type::size_type size_type; - + static_assert((is_same<_Tp, value_type>::value), "" ); + protected: container_type c; Modified: libcxx/trunk/test/std/containers/container.adaptors/priority.queue/types.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/container.adaptors/priority.queue/types.pass.cpp?rev=263450&r1=263449&r2=263450&view=diff ============================================================================== --- libcxx/trunk/test/std/containers/container.adaptors/priority.queue/types.pass.cpp (original) +++ libcxx/trunk/test/std/containers/container.adaptors/priority.queue/types.pass.cpp Mon Mar 14 12:58:11 2016 @@ -48,13 +48,13 @@ struct C int main() { - static_assert((std::is_same<std::priority_queue<int>::container_type, std::vector<int> >::value), ""); - static_assert((std::is_same<std::priority_queue<double, std::deque<int> >::container_type, std::deque<int> >::value), ""); - static_assert((std::is_same<std::priority_queue<double, std::deque<int> >::value_type, int>::value), ""); - static_assert((std::is_same<std::priority_queue<int>::reference, std::vector<int>::reference>::value), ""); - static_assert((std::is_same<std::priority_queue<int>::const_reference, std::vector<int>::const_reference>::value), ""); - static_assert((std::is_same<std::priority_queue<int>::size_type, std::vector<int>::size_type>::value), ""); - static_assert((std::uses_allocator<std::priority_queue<int>, std::allocator<int> >::value), ""); + static_assert(( std::is_same<std::priority_queue<int>::container_type, std::vector<int> >::value), ""); + static_assert(( std::is_same<std::priority_queue<int, std::deque<int> >::container_type, std::deque<int> >::value), ""); + static_assert(( std::is_same<std::priority_queue<int, std::deque<int> >::value_type, int>::value), ""); + static_assert(( std::is_same<std::priority_queue<int>::reference, std::vector<int>::reference>::value), ""); + static_assert(( std::is_same<std::priority_queue<int>::const_reference, std::vector<int>::const_reference>::value), ""); + static_assert(( std::is_same<std::priority_queue<int>::size_type, std::vector<int>::size_type>::value), ""); + static_assert(( std::uses_allocator<std::priority_queue<int>, std::allocator<int> >::value), ""); static_assert((!std::uses_allocator<std::priority_queue<int, C>, std::allocator<int> >::value), ""); test t; } Modified: libcxx/trunk/test/std/containers/container.adaptors/queue/queue.defn/types.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/container.adaptors/queue/queue.defn/types.pass.cpp?rev=263450&r1=263449&r2=263450&view=diff ============================================================================== --- libcxx/trunk/test/std/containers/container.adaptors/queue/queue.defn/types.pass.cpp (original) +++ libcxx/trunk/test/std/containers/container.adaptors/queue/queue.defn/types.pass.cpp Mon Mar 14 12:58:11 2016 @@ -46,13 +46,13 @@ struct C int main() { - static_assert((std::is_same<std::queue<int>::container_type, std::deque<int> >::value), ""); - static_assert((std::is_same<std::queue<double, std::vector<int> >::container_type, std::vector<int> >::value), ""); - static_assert((std::is_same<std::queue<double, std::vector<int> >::value_type, int>::value), ""); - static_assert((std::is_same<std::queue<int>::reference, std::deque<int>::reference>::value), ""); - static_assert((std::is_same<std::queue<int>::const_reference, std::deque<int>::const_reference>::value), ""); - static_assert((std::is_same<std::queue<int>::size_type, std::deque<int>::size_type>::value), ""); - static_assert((std::uses_allocator<std::queue<int>, std::allocator<int> >::value), ""); + static_assert(( std::is_same<std::queue<int>::container_type, std::deque<int> >::value), ""); + static_assert(( std::is_same<std::queue<int, std::vector<int> >::container_type, std::vector<int> >::value), ""); + static_assert(( std::is_same<std::queue<int, std::vector<int> >::value_type, int>::value), ""); + static_assert(( std::is_same<std::queue<int>::reference, std::deque<int>::reference>::value), ""); + static_assert(( std::is_same<std::queue<int>::const_reference, std::deque<int>::const_reference>::value), ""); + static_assert(( std::is_same<std::queue<int>::size_type, std::deque<int>::size_type>::value), ""); + static_assert(( std::uses_allocator<std::queue<int>, std::allocator<int> >::value), ""); static_assert((!std::uses_allocator<std::queue<int, C>, std::allocator<int> >::value), ""); test t; } Modified: libcxx/trunk/test/std/containers/container.adaptors/stack/stack.defn/types.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/container.adaptors/stack/stack.defn/types.pass.cpp?rev=263450&r1=263449&r2=263450&view=diff ============================================================================== --- libcxx/trunk/test/std/containers/container.adaptors/stack/stack.defn/types.pass.cpp (original) +++ libcxx/trunk/test/std/containers/container.adaptors/stack/stack.defn/types.pass.cpp Mon Mar 14 12:58:11 2016 @@ -47,13 +47,13 @@ struct C int main() { - static_assert((std::is_same<std::stack<int>::container_type, std::deque<int> >::value), ""); - static_assert((std::is_same<std::stack<double, std::vector<int> >::container_type, std::vector<int> >::value), ""); - static_assert((std::is_same<std::stack<double, std::vector<int> >::value_type, int>::value), ""); - static_assert((std::is_same<std::stack<int>::reference, std::deque<int>::reference>::value), ""); - static_assert((std::is_same<std::stack<int>::const_reference, std::deque<int>::const_reference>::value), ""); - static_assert((std::is_same<std::stack<int>::size_type, std::deque<int>::size_type>::value), ""); - static_assert((std::uses_allocator<std::stack<int>, std::allocator<int> >::value), ""); + static_assert(( std::is_same<std::stack<int>::container_type, std::deque<int> >::value), ""); + static_assert(( std::is_same<std::stack<int, std::vector<int> >::container_type, std::vector<int> >::value), ""); + static_assert(( std::is_same<std::stack<int, std::vector<int> >::value_type, int>::value), ""); + static_assert(( std::is_same<std::stack<int>::reference, std::deque<int>::reference>::value), ""); + static_assert(( std::is_same<std::stack<int>::const_reference, std::deque<int>::const_reference>::value), ""); + static_assert(( std::is_same<std::stack<int>::size_type, std::deque<int>::size_type>::value), ""); + static_assert(( std::uses_allocator<std::stack<int>, std::allocator<int> >::value), ""); static_assert((!std::uses_allocator<std::stack<int, C>, std::allocator<int> >::value), ""); test t; } Modified: libcxx/trunk/www/cxx1z_status.html URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/www/cxx1z_status.html?rev=263450&r1=263449&r2=263450&view=diff ============================================================================== --- libcxx/trunk/www/cxx1z_status.html (original) +++ libcxx/trunk/www/cxx1z_status.html Mon Mar 14 12:58:11 2016 @@ -217,7 +217,7 @@ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2559">2559</a></td><td>Error in LWG 2234's resolution</td><td>Jacksonville</td><td>Complete</td></tr> <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2560">2560</a></td><td><tt>is_constructible</tt> underspecified when applied to a function type</td><td>Jacksonville</td><td>Broken in 3.6; See r261653.</td></tr> <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2565">2565</a></td><td><tt>std::function</tt>'s move constructor should guarantee nothrow for <tt>reference_wrapper</tt>s and function pointers</td><td>Jacksonville</td><td></td></tr> - <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2566">2566</a></td><td>Requirements on the first template parameter of container adaptors</td><td>Jacksonville</td><td></td></tr> + <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2566">2566</a></td><td>Requirements on the first template parameter of container adaptors</td><td>Jacksonville</td><td>Complete</td></tr> <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2571">2571</a></td><td>§[map.modifiers]/2 imposes nonsensical requirement on <tt>insert(InputIterator, InputIterator)</tt></td><td>Jacksonville</td><td>Complete</td></tr> <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2572">2572</a></td><td>The remarks for <tt>shared_ptr::operator*</tt> should apply to <i>cv</i>-qualified <tt>void</tt> as well</td><td>Jacksonville</td><td>Complete</td></tr> <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2574">2574</a></td><td>[fund.ts.v2] <tt>std::experimental::function::operator=(F&&)</tt> should be constrained</td><td>Jacksonville</td><td></td></tr> @@ -238,7 +238,7 @@ <!-- <tr><td></td><td></td><td></td><td></td></tr> --> </table> - <p>Last Updated: 9-Mar-2016</p> + <p>Last Updated: 14-Mar-2016</p> </div> </body> </html> _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits