Implement LWG#2566: Requirements on the first template parameter of container adaptors

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@263450 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/queue b/include/queue
index 6f49c87..81b83a7 100644
--- a/include/queue
+++ b/include/queue
@@ -198,6 +198,7 @@
     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 @@
     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;
diff --git a/include/stack b/include/stack
index 2992b09..64fd652 100644
--- a/include/stack
+++ b/include/stack
@@ -112,7 +112,8 @@
     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;
 
diff --git a/test/std/containers/container.adaptors/priority.queue/types.pass.cpp b/test/std/containers/container.adaptors/priority.queue/types.pass.cpp
index ade20d4..802cd00 100644
--- a/test/std/containers/container.adaptors/priority.queue/types.pass.cpp
+++ b/test/std/containers/container.adaptors/priority.queue/types.pass.cpp
@@ -48,13 +48,13 @@
 
 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;
 }
diff --git a/test/std/containers/container.adaptors/queue/queue.defn/types.pass.cpp b/test/std/containers/container.adaptors/queue/queue.defn/types.pass.cpp
index cc918a3..7f1883a 100644
--- a/test/std/containers/container.adaptors/queue/queue.defn/types.pass.cpp
+++ b/test/std/containers/container.adaptors/queue/queue.defn/types.pass.cpp
@@ -46,13 +46,13 @@
 
 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;
 }
diff --git a/test/std/containers/container.adaptors/stack/stack.defn/types.pass.cpp b/test/std/containers/container.adaptors/stack/stack.defn/types.pass.cpp
index afc5ebd..77a798b 100644
--- a/test/std/containers/container.adaptors/stack/stack.defn/types.pass.cpp
+++ b/test/std/containers/container.adaptors/stack/stack.defn/types.pass.cpp
@@ -47,13 +47,13 @@
 
 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;
 }
diff --git a/www/cxx1z_status.html b/www/cxx1z_status.html
index 9c53cd9..0445145 100644
--- a/www/cxx1z_status.html
+++ b/www/cxx1z_status.html
@@ -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>&sect;[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&amp;&amp;)</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>