]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
basic_string.h (basic_string): Add cbegin(), cend(), crbegin(), crend() in C++0x...
authorBenjamin Kosnik <bkoz@gcc.gnu.org>
Tue, 25 Aug 2009 22:29:08 +0000 (22:29 +0000)
committerBenjamin Kosnik <bkoz@gcc.gnu.org>
Tue, 25 Aug 2009 22:29:08 +0000 (22:29 +0000)
2009-08-25  Benjamin Kosnik  <bkoz@redhat.com>

* include/bits/basic_string.h (basic_string): Add cbegin(),
cend(), crbegin(), crend() in C++0x mode.
* config/abi/pre/gnu.ver: Add exports.

* testsuite/util/testsuite_containers.h: New.
* testsuite/util/testsuite_container_traits.h: New.
* testsuite/21_strings/basic_string/requirements/citerators.cc: New.
* testsuite/21_strings/basic_string/requirements/typedefs.cc: New.
* testsuite/ext/vstring/requirements/citerators.cc: Edit.
* testsuite/ext/vstring/requirements/typedefs.cc: New.
* testsuite/23_containers/unordered_map/requirements/
cliterators.cc: Edit.
* testsuite/23_containers/unordered_map/requirements/
citerators.cc: Edit.
* testsuite/23_containers/unordered_map/requirements/
explicit_instantiation/1.cc: New.
* testsuite/23_containers/unordered_map/requirements/
explicit_instantiation/2.cc: New.
* testsuite/23_containers/unordered_map/requirements/
explicit_instantiation/3.cc: New.
* testsuite/23_containers/unordered_map/requirements/typedefs.cc: Edit.
* testsuite/23_containers/unordered_map/requirements/
explicit_instantiation.cc: Move to nested directory.
* testsuite/23_containers/queue/requirements/typedefs.cc: New.
* testsuite/23_containers/priority_queue/requirements/typedefs.cc: New.
* testsuite/23_containers/multimap/requirements/citerators.cc: Edit.
* testsuite/23_containers/multimap/requirements/typedefs.cc: New.
* testsuite/23_containers/set/requirements/citerators.cc: Edit.
* testsuite/23_containers/set/requirements/typedefs.cc: New.
* testsuite/23_containers/unordered_multimap/requirements/
cliterators.cc: Edit.
* testsuite/23_containers/unordered_multimap/requirements/
citerators.cc: Edit.
* testsuite/23_containers/unordered_multimap/requirements/
explicit_instantiation/1.cc: New.
* testsuite/23_containers/unordered_multimap/requirements/
explicit_instantiation/2.cc: Edit.: New.
* testsuite/23_containers/unordered_multimap/requirements/
explicit_instantiation/3.cc: New.
* testsuite/23_containers/unordered_multimap/requirements/
typedefs.cc: Edit.
* testsuite/23_containers/unordered_multimap/requirements/
explicit_instantiation.cc: Move to nested.
* testsuite/23_containers/forward_list/requirements/citerators.cc: New.
* testsuite/23_containers/forward_list/requirements/1.cc: Remove.
* testsuite/23_containers/forward_list/requirements/dr438/
insert_neg.cc: New.
* testsuite/23_containers/forward_list/requirements/dr438/
assign_neg.cc: New.
* testsuite/23_containers/forward_list/requirements/dr438/
constructor_1_neg.cc: New.
* testsuite/23_containers/forward_list/requirements/dr438/
constructor_2_neg.cc: New.
* testsuite/23_containers/forward_list/requirements/dr438/
constructor.cc: New.
* testsuite/23_containers/forward_list/requirements/typedefs.cc: New.
* testsuite/23_containers/unordered_set/requirements/
cliterators.cc: Edit.
* testsuite/23_containers/unordered_set/requirements/
citerators.cc: Edit.
* testsuite/23_containers/unordered_set/requirements/
explicit_instantiation/1.cc: New.
* testsuite/23_containers/unordered_set/requirements/
explicit_instantiation/2.cc: New.
* testsuite/23_containers/unordered_set/requirements/
explicit_instantiation/3.cc: New.
* testsuite/23_containers/unordered_set/requirements/typedefs.cc: Edit.
* testsuite/23_containers/unordered_set/requirements/
explicit_instantiation.cc: Move to nested.
* testsuite/23_containers/vector/requirements/citerators.cc: Edit.
* testsuite/23_containers/vector/requirements/dr438/bool/
constructor.cc: Move.
* testsuite/23_containers/vector/requirements/typedefs.cc: New.
* testsuite/23_containers/vector/bool/requirements/citerators.cc: Edit.
* testsuite/23_containers/vector/bool/requirements/dr438/
constructor.cc: New.
* testsuite/23_containers/deque/requirements/citerators.cc: Edit.
* testsuite/23_containers/deque/requirements/typedefs.cc
* testsuite/23_containers/stack/requirements/typedefs.cc
* testsuite/23_containers/multiset/requirements/citerators.cc: Edit.
* testsuite/23_containers/multiset/requirements/typedefs.cc: New.
* testsuite/23_containers/list/requirements/citerators.cc: Edit.
* testsuite/23_containers/list/requirements/typedefs.cc: New.
* testsuite/23_containers/unordered_multiset/requirements/
cliterators.cc: Edit.
* testsuite/23_containers/unordered_multiset/requirements/
citerators.cc: Edit.
* testsuite/23_containers/unordered_multiset/requirements/
explicit_instantiation.cc: Move.
* testsuite/23_containers/unordered_multiset/requirements/
explicit_instantiation/1.cc: New.
* testsuite/23_containers/unordered_multiset/requirements/
explicit_instantiation/2.cc: New.
* testsuite/23_containers/unordered_multiset/requirements/
explicit_instantiation/3.cc: New.
* testsuite/23_containers/unordered_multiset/requirements/typedefs.cc
* testsuite/23_containers/map/requirements/citerators.cc: Edit.
* testsuite/23_containers/map/requirements/typedefs.cc: New.
* testsuite/23_containers/array/requirements/citerators.cc: Edit.
* testsuite/23_containers/array/requirements/explicit_instantiation.cc:
Move.
* testsuite/23_containers/array/requirements/
explicit_instantiation/1.cc: New.
* testsuite/23_containers/array/requirements/
explicit_instantiation/2.cc: New.
* testsuite/23_containers/array/requirements/typedefs.cc: New.

From-SVN: r151106

64 files changed:
libstdc++-v3/ChangeLog
libstdc++-v3/config/abi/pre/gnu.ver
libstdc++-v3/include/bits/basic_string.h
libstdc++-v3/testsuite/21_strings/basic_string/requirements/citerators.cc [new file with mode: 0644]
libstdc++-v3/testsuite/21_strings/basic_string/requirements/typedefs.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/array/requirements/citerators.cc
libstdc++-v3/testsuite/23_containers/array/requirements/explicit_instantiation/1.cc [moved from libstdc++-v3/testsuite/23_containers/array/requirements/explicit_instantiation.cc with 99% similarity]
libstdc++-v3/testsuite/23_containers/array/requirements/explicit_instantiation/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/array/requirements/typedefs.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/deque/requirements/citerators.cc
libstdc++-v3/testsuite/23_containers/deque/requirements/typedefs.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/forward_list/requirements/1.cc [deleted file]
libstdc++-v3/testsuite/23_containers/forward_list/requirements/citerators.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/assign_neg.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_1_neg.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_2_neg.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/insert_neg.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/forward_list/requirements/typedefs.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/list/requirements/citerators.cc
libstdc++-v3/testsuite/23_containers/list/requirements/typedefs.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/map/requirements/citerators.cc
libstdc++-v3/testsuite/23_containers/map/requirements/typedefs.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/multimap/requirements/citerators.cc
libstdc++-v3/testsuite/23_containers/multimap/requirements/typedefs.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/multiset/requirements/citerators.cc
libstdc++-v3/testsuite/23_containers/multiset/requirements/typedefs.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/priority_queue/requirements/typedefs.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/queue/requirements/typedefs.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/set/requirements/citerators.cc
libstdc++-v3/testsuite/23_containers/set/requirements/typedefs.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/stack/requirements/typedefs.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/unordered_map/requirements/citerators.cc
libstdc++-v3/testsuite/23_containers/unordered_map/requirements/cliterators.cc
libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/1.cc [moved from libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation.cc with 100% similarity]
libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/3.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/unordered_map/requirements/typedefs.cc
libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/citerators.cc
libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/cliterators.cc
libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation/1.cc [moved from libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation.cc with 100% similarity]
libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation/3.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/typedefs.cc
libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/citerators.cc
libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/cliterators.cc
libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/explicit_instantiation/1.cc [moved from libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/explicit_instantiation.cc with 100% similarity]
libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/explicit_instantiation/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/explicit_instantiation/3.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/typedefs.cc
libstdc++-v3/testsuite/23_containers/unordered_set/requirements/citerators.cc
libstdc++-v3/testsuite/23_containers/unordered_set/requirements/cliterators.cc
libstdc++-v3/testsuite/23_containers/unordered_set/requirements/explicit_instantiation/1.cc [moved from libstdc++-v3/testsuite/23_containers/unordered_set/requirements/explicit_instantiation.cc with 100% similarity]
libstdc++-v3/testsuite/23_containers/unordered_set/requirements/explicit_instantiation/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/unordered_set/requirements/explicit_instantiation/3.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/unordered_set/requirements/typedefs.cc
libstdc++-v3/testsuite/23_containers/vector/bool/requirements/citerators.cc
libstdc++-v3/testsuite/23_containers/vector/bool/requirements/dr438/constructor.cc [moved from libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/bool/constructor.cc with 100% similarity]
libstdc++-v3/testsuite/23_containers/vector/requirements/citerators.cc
libstdc++-v3/testsuite/23_containers/vector/requirements/typedefs.cc [new file with mode: 0644]
libstdc++-v3/testsuite/ext/vstring/requirements/citerators.cc
libstdc++-v3/testsuite/ext/vstring/requirements/typedefs.cc [new file with mode: 0644]
libstdc++-v3/testsuite/util/testsuite_container_traits.h [new file with mode: 0644]
libstdc++-v3/testsuite/util/testsuite_containers.h [new file with mode: 0644]

index 26759a4bf4351a5e1baf50078a8a3fb930bcf66c..cd892b2c879a9cb223aab63f246be28073338c6a 100644 (file)
@@ -1,3 +1,112 @@
+2009-08-25  Benjamin Kosnik  <bkoz@redhat.com>
+
+       * include/bits/basic_string.h (basic_string): Add cbegin(),
+       cend(), crbegin(), crend() in C++0x mode.
+       * config/abi/pre/gnu.ver: Add exports.
+
+       * testsuite/util/testsuite_containers.h: New.
+       * testsuite/util/testsuite_container_traits.h: New.
+       * testsuite/21_strings/basic_string/requirements/citerators.cc: New.
+       * testsuite/21_strings/basic_string/requirements/typedefs.cc: New.
+       * testsuite/ext/vstring/requirements/citerators.cc: Edit.
+       * testsuite/ext/vstring/requirements/typedefs.cc: New.
+       * testsuite/23_containers/unordered_map/requirements/
+       cliterators.cc: Edit.
+       * testsuite/23_containers/unordered_map/requirements/
+       citerators.cc: Edit.
+       * testsuite/23_containers/unordered_map/requirements/
+       explicit_instantiation/1.cc: New.
+       * testsuite/23_containers/unordered_map/requirements/
+       explicit_instantiation/2.cc: New.
+       * testsuite/23_containers/unordered_map/requirements/
+       explicit_instantiation/3.cc: New.
+       * testsuite/23_containers/unordered_map/requirements/typedefs.cc: Edit.
+       * testsuite/23_containers/unordered_map/requirements/
+       explicit_instantiation.cc: Move to nested directory.
+       * testsuite/23_containers/queue/requirements/typedefs.cc: New.
+       * testsuite/23_containers/priority_queue/requirements/typedefs.cc: New.
+       * testsuite/23_containers/multimap/requirements/citerators.cc: Edit.
+       * testsuite/23_containers/multimap/requirements/typedefs.cc: New.
+       * testsuite/23_containers/set/requirements/citerators.cc: Edit.
+       * testsuite/23_containers/set/requirements/typedefs.cc: New.
+       * testsuite/23_containers/unordered_multimap/requirements/
+       cliterators.cc: Edit.
+       * testsuite/23_containers/unordered_multimap/requirements/
+       citerators.cc: Edit.
+       * testsuite/23_containers/unordered_multimap/requirements/
+       explicit_instantiation/1.cc: New.
+       * testsuite/23_containers/unordered_multimap/requirements/
+       explicit_instantiation/2.cc: Edit.: New.
+       * testsuite/23_containers/unordered_multimap/requirements/
+       explicit_instantiation/3.cc: New.
+       * testsuite/23_containers/unordered_multimap/requirements/
+       typedefs.cc: Edit.
+       * testsuite/23_containers/unordered_multimap/requirements/
+       explicit_instantiation.cc: Move to nested.
+       * testsuite/23_containers/forward_list/requirements/citerators.cc: New.
+       * testsuite/23_containers/forward_list/requirements/1.cc: Remove.
+       * testsuite/23_containers/forward_list/requirements/dr438/
+       insert_neg.cc: New.
+       * testsuite/23_containers/forward_list/requirements/dr438/
+       assign_neg.cc: New.
+       * testsuite/23_containers/forward_list/requirements/dr438/
+       constructor_1_neg.cc: New.
+       * testsuite/23_containers/forward_list/requirements/dr438/
+       constructor_2_neg.cc: New.
+       * testsuite/23_containers/forward_list/requirements/dr438/
+       constructor.cc: New.
+       * testsuite/23_containers/forward_list/requirements/typedefs.cc: New.
+       * testsuite/23_containers/unordered_set/requirements/
+       cliterators.cc: Edit.
+       * testsuite/23_containers/unordered_set/requirements/
+       citerators.cc: Edit.
+       * testsuite/23_containers/unordered_set/requirements/
+       explicit_instantiation/1.cc: New.
+       * testsuite/23_containers/unordered_set/requirements/
+       explicit_instantiation/2.cc: New.
+       * testsuite/23_containers/unordered_set/requirements/
+       explicit_instantiation/3.cc: New.
+       * testsuite/23_containers/unordered_set/requirements/typedefs.cc: Edit.
+       * testsuite/23_containers/unordered_set/requirements/
+       explicit_instantiation.cc: Move to nested.
+       * testsuite/23_containers/vector/requirements/citerators.cc: Edit.
+       * testsuite/23_containers/vector/requirements/dr438/bool/
+       constructor.cc: Move.
+       * testsuite/23_containers/vector/requirements/typedefs.cc: New.
+       * testsuite/23_containers/vector/bool/requirements/citerators.cc: Edit.
+       * testsuite/23_containers/vector/bool/requirements/dr438/
+       constructor.cc: New.
+       * testsuite/23_containers/deque/requirements/citerators.cc: Edit.
+       * testsuite/23_containers/deque/requirements/typedefs.cc
+       * testsuite/23_containers/stack/requirements/typedefs.cc
+       * testsuite/23_containers/multiset/requirements/citerators.cc: Edit.
+       * testsuite/23_containers/multiset/requirements/typedefs.cc: New.
+       * testsuite/23_containers/list/requirements/citerators.cc: Edit.
+       * testsuite/23_containers/list/requirements/typedefs.cc: New.
+       * testsuite/23_containers/unordered_multiset/requirements/
+       cliterators.cc: Edit.
+       * testsuite/23_containers/unordered_multiset/requirements/
+       citerators.cc: Edit.
+       * testsuite/23_containers/unordered_multiset/requirements/
+       explicit_instantiation.cc: Move.
+       * testsuite/23_containers/unordered_multiset/requirements/
+       explicit_instantiation/1.cc: New.
+       * testsuite/23_containers/unordered_multiset/requirements/
+       explicit_instantiation/2.cc: New.
+       * testsuite/23_containers/unordered_multiset/requirements/
+       explicit_instantiation/3.cc: New.
+       * testsuite/23_containers/unordered_multiset/requirements/typedefs.cc
+       * testsuite/23_containers/map/requirements/citerators.cc: Edit.
+       * testsuite/23_containers/map/requirements/typedefs.cc: New.
+       * testsuite/23_containers/array/requirements/citerators.cc: Edit.
+       * testsuite/23_containers/array/requirements/explicit_instantiation.cc:
+       Move.
+       * testsuite/23_containers/array/requirements/
+       explicit_instantiation/1.cc: New.
+       * testsuite/23_containers/array/requirements/
+       explicit_instantiation/2.cc: New.
+       * testsuite/23_containers/array/requirements/typedefs.cc: New.
+
 2009-08-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        * configure.ac (AC_PREREQ): Bump to 2.64.
 
        PR libstdc++/41061
        * include/bits/random.h (operator<<(std::basic_ostream<>&,
-       const std::lognormal_distribution<>&), 
+       const std::lognormal_distribution<>&),
        operator>>(std::basic_istream<>&, std::lognormal_distribution<>&),
        operator<<(std::basic_ostream<>&, const std::gamma_distribution<>&),
        operator>>(std::basic_istream<>&, std::gamma_distribution<>&),
 2009-08-06  Benjamin Kosnik  <bkoz@redhat.com>
 
        * src/compatibility.cc: Make C++0x safe, add in explicit casts to
-        bool for stream sentry objects.
-        * include/bits/istream.tcc: Same.
-        * include/bits/ostream.tcc: Same.
-        * include/bits/basic_string.tcc: Same.
+       bool for stream sentry objects.
+       * include/bits/istream.tcc: Same.
+       * include/bits/ostream.tcc: Same.
+       * include/bits/basic_string.tcc: Same.
        * include/bits/ostream_insert.h: Same.
-        * src/istream.cc: Same.
+       * src/istream.cc: Same.
 
 2009-08-04  Paolo Carlini  <paolo.carlini@oracle.com>
 
        const param_type&): Define here.
        (geometric_distribution<>::operator()(_UniformRandomNumberGenerator&,
        const param_type&), discrete_distribution<>::operator()
-       (_UniformRandomNumberGenerator&, const param_type&), 
+       (_UniformRandomNumberGenerator&, const param_type&),
        piecewise_constant_distribution<>::operator()
        (_UniformRandomNumberGenerator&, const param_type&),
        piecewise_linear_distribution<>::operator()
index c4967db551379688058b42b8461697cc23167919..e73b5fef1692857c127e8a0c4ee5d8650e5cf1a7 100644 (file)
@@ -193,7 +193,8 @@ GLIBCXX_3.4 {
     _ZNSsaSE[PRc]*;
     _ZNSsixE*;
     _ZNSspLE[PRc]*;
-    _ZNKSs[0-9][a-z]*;
+    _ZNKSs[0-9][a-b]*;
+    _ZNKSs[0-9][d-z]*;
     _ZNKSs[0-9][0-9][a-z]*;
     _ZNKSs[a-z]*;
     _ZNKSs4_Rep12_M_is_leakedEv;
@@ -205,12 +206,17 @@ GLIBCXX_3.4 {
     _ZNKSs8_M_limit*;
     _ZNKSs9_M_ibeginEv;
     _ZStplIcSt11char_traitsIcESaIcEESbIT_T0_T1_E*;
+    _ZNKSs7compare*; 
+    _ZNKSs5c_strEv;
+    _ZNKSs8capacityEv;
+    _ZNKSs4copyEPcmm;
 
     # std::wstring
     _ZNSbIwSt11char_traitsIwESaIwEEC[12][EI][PRjmvN]*;
     _ZNSbIwSt11char_traitsIwESaIwEED*;
     _ZNSbIwSt11char_traitsIwESaIwEE[0-58-9][a-z]*;
-    _ZNSbIwSt11char_traitsIwESaIwEE[67][a-z]*E[PRwjmv]*;
+    _ZNSbIwSt11char_traitsIwESaIwEE[67][a-b]*E[PRwjmv]*;
+    _ZNSbIwSt11char_traitsIwESaIwEE[67][d-z]*E[PRwjmv]*;
     _ZNSbIwSt11char_traitsIwESaIwEE7[a-z]*EES6_[NPRjm]*;
     _ZNSbIwSt11char_traitsIwESaIwEE7[a-z]*EES6_S[56]*;
     _ZNSbIwSt11char_traitsIwESaIwEE12_Alloc_hiderC*;
@@ -250,6 +256,7 @@ GLIBCXX_3.4 {
     _ZNKSbIwSt11char_traitsIwESaIwEE8_M_limit*;
     _ZNKSbIwSt11char_traitsIwESaIwEE9_M_ibeginEv;
     _ZStplIwSt11char_traitsIwESaIwEESbIT_T0_T1_E*;
+    _ZNKSbIwSt11char_traitsIwESaIwEE7compare*;
 
     # std::basic_streambuf
     _ZNSt15basic_streambufI[cw]St11char_traitsI[cw]EE[CD]*;
@@ -980,6 +987,16 @@ GLIBCXX_3.4.13 {
     _ZTISt12future_error;
     _ZSt20__throw_future_errori;
 
+    # string|wstring ::cbegin member functions
+    _ZNKSs6cbeginEv;
+    _ZNKSs4cendEv;
+    _ZNKSs7crbeginEv;
+    _ZNKSs5crendEv;
+    _ZNKSbIwSt11char_traitsIwESaIwEE4cendEv;
+    _ZNKSbIwSt11char_traitsIwESaIwEE6cbeginEv;
+    _ZNKSbIwSt11char_traitsIwESaIwEE7crbeginEv;
+    _ZNKSbIwSt11char_traitsIwESaIwEE5crendEv;
+
 } GLIBCXX_3.4.12;
 
 # Symbols in the support library (libsupc++) have their own tag.
index 085aea463b6fb69d95060f2c126ea1e3ebaa26a2..bd54537cdc10cab357b8e1601e6b1afcc90d15db 100644 (file)
@@ -620,6 +620,42 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       rend() const
       { return const_reverse_iterator(this->begin()); }
 
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+      /**
+       *  Returns a read-only (constant) iterator that points to the first
+       *  character in the %string.
+       */
+      const_iterator
+      cbegin() const
+      { return const_iterator(this->_M_data()); }
+
+      /**
+       *  Returns a read-only (constant) iterator that points one past the
+       *  last character in the %string.
+       */
+      const_iterator
+      cend() const
+      { return const_iterator(this->_M_data() + this->size()); }
+
+      /**
+       *  Returns a read-only (constant) reverse iterator that points
+       *  to the last character in the %string.  Iteration is done in
+       *  reverse element order.
+       */
+      const_reverse_iterator
+      crbegin() const
+      { return const_reverse_iterator(this->end()); }
+
+      /**
+       *  Returns a read-only (constant) reverse iterator that points
+       *  to one before the first character in the %string.  Iteration
+       *  is done in reverse element order.
+       */
+      const_reverse_iterator
+      crend() const
+      { return const_reverse_iterator(this->begin()); }
+#endif
+
     public:
       // Capacity:
       ///  Returns the number of characters in the string, not including any
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/requirements/citerators.cc b/libstdc++-v3/testsuite/21_strings/basic_string/requirements/citerators.cc
new file mode 100644 (file)
index 0000000..fe262b0
--- /dev/null
@@ -0,0 +1,29 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-require-string-conversions "" }
+
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <string>
+#include <testsuite_containers.h>
+
+int main()
+{
+  __gnu_test::citerator<std::string> test1;
+  __gnu_test::citerator<std::wstring> test2;
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/requirements/typedefs.cc b/libstdc++-v3/testsuite/21_strings/basic_string/requirements/typedefs.cc
new file mode 100644 (file)
index 0000000..aa0ac08
--- /dev/null
@@ -0,0 +1,26 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <testsuite_containers.h>
+#include <string>
+
+// Check container for required typedefs.
+__gnu_test::types<std::string> t1;
+__gnu_test::types<std::wstring> t2;
index 0597dcfc5ff699ffb9679a18c4d8198ce5164487..c448a8419ecff9b6fb18416ba7e2e085f576170b 100644 (file)
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-
 #include <array>
-#include <testsuite_hooks.h>
-
-void
-test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  std::array<int, 7> a;
-  VERIFY( a.cbegin() == a.begin() );
-  VERIFY( a.cend() == a.end() );
-  VERIFY( a.crbegin() == a.rbegin() );
-  VERIFY( a.crend() == a.rend() );
-  VERIFY( a.cbegin() != a.cend() );
-  VERIFY( a.crbegin() != a.crend() );  
-}
+#include <testsuite_containers.h>
 
 int main()
 {
-  test01();
+  typedef std::array<int, 7> test_type;
+  __gnu_test::citerator<test_type> test;
   return 0;
 }
similarity index 99%
rename from libstdc++-v3/testsuite/23_containers/array/requirements/explicit_instantiation.cc
rename to libstdc++-v3/testsuite/23_containers/array/requirements/explicit_instantiation/1.cc
index 75fcb3cddaf95d783a10c528d71cab21d6105f2d..0e1044124161363c841e9b421afdc1aeae43108e 100644 (file)
@@ -18,7 +18,6 @@
 // along with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-
 #include <array>
 
 template class std::array<int, 5>;
diff --git a/libstdc++-v3/testsuite/23_containers/array/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/23_containers/array/requirements/explicit_instantiation/2.cc
new file mode 100644 (file)
index 0000000..aadf76b
--- /dev/null
@@ -0,0 +1,27 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+// This file tests explicit instantiation of library containers
+
+#include <array>
+#include <testsuite_hooks.h>
+#include <testsuite_api.h>
+
+template class std::array<__gnu_test::NonDefaultConstructible, 3>;
diff --git a/libstdc++-v3/testsuite/23_containers/array/requirements/typedefs.cc b/libstdc++-v3/testsuite/23_containers/array/requirements/typedefs.cc
new file mode 100644 (file)
index 0000000..152988d
--- /dev/null
@@ -0,0 +1,25 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <testsuite_containers.h>
+#include <array>
+
+// Check container for required typedefs.
+__gnu_test::types<std::array<int, 10> > t;
index dd4179da906a150dfc915d389ed9ea0bb59dadf6..4a05e606010fb57a61d2493b4e86eb3b5f7760c9 100644 (file)
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-
 #include <deque>
-#include <testsuite_hooks.h>
-
-void
-test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  std::deque<int> d(7);
-  VERIFY( d.cbegin() == d.begin() );
-  VERIFY( d.cend() == d.end() );
-  VERIFY( d.crbegin() == d.rbegin() );
-  VERIFY( d.crend() == d.rend() );
-  VERIFY( d.cbegin() != d.cend() );
-  VERIFY( d.crbegin() != d.crend() );  
-}
+#include <testsuite_containers.h>
 
 int main()
 {
-  test01();
+  typedef std::deque<int> test_type;
+  __gnu_test::citerator<test_type> test;
   return 0;
 }
diff --git a/libstdc++-v3/testsuite/23_containers/deque/requirements/typedefs.cc b/libstdc++-v3/testsuite/23_containers/deque/requirements/typedefs.cc
new file mode 100644 (file)
index 0000000..6263951
--- /dev/null
@@ -0,0 +1,25 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <testsuite_containers.h>
+#include <deque>
+
+// Check container for required typedefs.
+__gnu_test::types<std::deque<int> > t;
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/1.cc b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/1.cc
deleted file mode 100644 (file)
index 67aa70b..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-// { dg-options "-std=gnu++0x" }
-
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library.  This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 3, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without Pred the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING3.  If not see
-// <http://www.gnu.org/licenses/>.
-
-// 23.2.3.n forward_list xxx [lib.forward_list.xxx]
-
-#include <forward_list>
-#include <testsuite_hooks.h>
-
-bool test __attribute__((unused)) = true;
-
-// A nontrivial type.
-template<typename T>
-  struct A { };
-
-// Another nontrivial type
-struct B { };
-
-// A nontrivial type convertible from an int
-struct C
-{
-  C(int i) : i_(i) { }
-  bool operator==(const C& rhs) { return i_ == rhs.i_; }
-  int i_;
-};
-
-// This test verifies the following.
-//
-void
-test01()
-{
-  std::forward_list< A<B> > lst;
-  VERIFY(lst.begin() == lst.end());
-  VERIFY(std::distance(lst.begin(), lst.end()) == 0);
-
-  // check type definitions -- will fail compile if missing
-  typedef std::forward_list< A<B> >::reference              reference;
-  typedef std::forward_list< A<B> >::const_reference        const_reference;
-  typedef std::forward_list< A<B> >::iterator               iterator;
-  typedef std::forward_list< A<B> >::const_iterator         const_iterator;
-  typedef std::forward_list< A<B> >::size_type              size_type;
-  typedef std::forward_list< A<B> >::difference_type        difference_type;
-  typedef std::forward_list< A<B> >::value_type             value_type;
-  typedef std::forward_list< A<B> >::allocator_type         allocator_type;
-  typedef std::forward_list< A<B> >::pointer                pointer;
-  typedef std::forward_list< A<B> >::const_pointer          const_pointer;
-}
-
-int
-main()
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/citerators.cc b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/citerators.cc
new file mode 100644 (file)
index 0000000..86fa26e
--- /dev/null
@@ -0,0 +1,41 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <forward_list>
+#include <testsuite_containers.h>
+
+namespace __gnu_test
+{
+  template<>
+    struct populate<std::forward_list<int>, true>
+    {
+      populate(std::forward_list<int>& container)
+      {
+       container.push_front(1);
+       container.push_front(2);
+      }      
+  };
+}
+
+int main()
+{
+  typedef std::forward_list<int>  test_type;
+  __gnu_test::citerator<test_type> test;
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/assign_neg.cc b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/assign_neg.cc
new file mode 100644 (file)
index 0000000..93f0e6d
--- /dev/null
@@ -0,0 +1,35 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+// { dg-error "no matching" "" { target *-*-* } 1209 }
+// { dg-excess-errors "" }
+
+// Copyright (C) 2009 Free Software Foundation
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <forward_list>
+
+struct A
+{
+  explicit A(int) { }
+};
+
+void f()
+{
+  typedef std::forward_list<A> test_type;
+  test_type l;
+  l.assign(10, 1);
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor.cc b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor.cc
new file mode 100644 (file)
index 0000000..407d8d1
--- /dev/null
@@ -0,0 +1,27 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2009 Free Software Foundation
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <forward_list>
+
+void f()
+{
+  typedef std::forward_list<int> test_type;
+  test_type l(10, 1);
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_1_neg.cc b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_1_neg.cc
new file mode 100644 (file)
index 0000000..70d0447
--- /dev/null
@@ -0,0 +1,29 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+// { dg-error "no matching" "" { target *-*-* } 1209 }
+// { dg-excess-errors "" }
+
+// Copyright (C) 2009 Free Software Foundation
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <forward_list>
+
+void f()
+{
+  typedef std::forward_list<std::forward_list<int> > test_type;
+  test_type l(10, 1);
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_2_neg.cc b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_2_neg.cc
new file mode 100644 (file)
index 0000000..2ee8b9f
--- /dev/null
@@ -0,0 +1,30 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+// { dg-error "no matching" "" { target *-*-* } 1209 }
+// { dg-excess-errors "" }
+
+// Copyright (C) 2009 Free Software Foundation
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <forward_list>
+#include <utility>
+
+void f()
+{
+  typedef std::forward_list<std::forward_list<std::pair<char, char> > > test_type;
+  test_type l('a', 'b');
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/insert_neg.cc b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/insert_neg.cc
new file mode 100644 (file)
index 0000000..a21c222
--- /dev/null
@@ -0,0 +1,35 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+// { dg-error "no matching" "" { target *-*-* } 1209 }
+// { dg-excess-errors "" }
+
+// Copyright (C) 2009 Free Software Foundation
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <forward_list>
+
+struct A
+{
+  explicit A(int) { }
+};
+
+void f()
+{
+  typedef std::forward_list<A> test_type;
+  test_type l;
+  l.insert_after(l.begin(), 10, 1);
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/typedefs.cc b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/typedefs.cc
new file mode 100644 (file)
index 0000000..3497b09
--- /dev/null
@@ -0,0 +1,25 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <testsuite_containers.h>
+#include <forward_list>
+
+// Check container for required typedefs.
+__gnu_test::types<std::forward_list<int> > t;
index 6bcffbb05eea0deb75afcc77073f2bd14b92b7bc..ac5bdec983afe0853126bc4caa7d7fa57a1a1ecb 100644 (file)
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-
 #include <list>
-#include <testsuite_hooks.h>
-
-void
-test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  typedef std::list<int> list_type;
-  list_type l(7);
-
-  VERIFY( l.cbegin() == l.begin() );
-  VERIFY( l.cend() == l.end() );
-  VERIFY( l.crbegin() == l.rbegin() );
-  VERIFY( l.crend() == l.rend() );
-  VERIFY( l.cbegin() != l.cend() );
-  VERIFY( l.crbegin() != l.crend() );  
-}
+#include <testsuite_containers.h>
 
 int main()
 {
-  test01();
+  typedef std::list<int>  test_type;
+  __gnu_test::citerator<test_type> test;
   return 0;
 }
diff --git a/libstdc++-v3/testsuite/23_containers/list/requirements/typedefs.cc b/libstdc++-v3/testsuite/23_containers/list/requirements/typedefs.cc
new file mode 100644 (file)
index 0000000..444ebb5
--- /dev/null
@@ -0,0 +1,25 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <testsuite_containers.h>
+#include <list>
+
+// Check container for required typedefs.
+__gnu_test::types<std::list<int> > t;
index 05e10aad2a6021391a05a47f5775033e43ba8883..17db1e7da38846ad03411c215eebbad663c71021 100644 (file)
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-
 #include <map>
-#include <testsuite_hooks.h>
-
-void
-test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  std::map<int, int> m;
-  m[1] = 1;
-  VERIFY( m.cbegin() == m.begin() );
-  VERIFY( m.cend() == m.end() );
-  VERIFY( m.crbegin() == m.rbegin() );
-  VERIFY( m.crend() == m.rend() );
-  VERIFY( m.cbegin() != m.cend() );
-  VERIFY( m.crbegin() != m.crend() );  
-}
+#include <testsuite_containers.h>
 
 int main()
 {
-  test01();
+  typedef std::map<int, int> test_type;
+  __gnu_test::citerator<test_type> test;
   return 0;
 }
diff --git a/libstdc++-v3/testsuite/23_containers/map/requirements/typedefs.cc b/libstdc++-v3/testsuite/23_containers/map/requirements/typedefs.cc
new file mode 100644 (file)
index 0000000..1325cc6
--- /dev/null
@@ -0,0 +1,25 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <testsuite_containers.h>
+#include <map>
+
+// Check container for required typedefs.
+__gnu_test::types<std::map<int, long> > t;
index 2daa88564cc303f2e30cc001903bb1dde9b1528b..15773cb51268ad5372b50ebb5b61969ab627a27e 100644 (file)
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-
 #include <map>
-#include <testsuite_hooks.h>
-
-void
-test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  typedef std::multimap<int, int> mm_type;
-  mm_type mm;
-  mm.insert(mm_type::value_type(1, 1));
-  VERIFY( mm.cbegin() == mm.begin() );
-  VERIFY( mm.cend() == mm.end() );
-  VERIFY( mm.crbegin() == mm.rbegin() );
-  VERIFY( mm.crend() == mm.rend() );
-  VERIFY( mm.cbegin() != mm.cend() );
-  VERIFY( mm.crbegin() != mm.crend() );  
-}
+#include <testsuite_containers.h>
 
 int main()
 {
-  test01();
+  typedef std::multimap<int, int> test_type;
+  __gnu_test::citerator<test_type> test;
   return 0;
 }
diff --git a/libstdc++-v3/testsuite/23_containers/multimap/requirements/typedefs.cc b/libstdc++-v3/testsuite/23_containers/multimap/requirements/typedefs.cc
new file mode 100644 (file)
index 0000000..38a4bc5
--- /dev/null
@@ -0,0 +1,25 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <testsuite_containers.h>
+#include <map>
+
+// Check container for required typedefs.
+__gnu_test::types<std::multimap<int, long> > t;
index 2efd054f62a62535297fa884ebc934e13f755237..bf3aa16447c6aac5146057100ed14fb872d0f301 100644 (file)
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-
 #include <set>
-#include <testsuite_hooks.h>
-
-void
-test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  std::multiset<int> ms;
-  ms.insert(1);
-  VERIFY( ms.cbegin() == ms.begin() );
-  VERIFY( ms.cend() == ms.end() );
-  VERIFY( ms.crbegin() == ms.rbegin() );
-  VERIFY( ms.crend() == ms.rend() );
-  VERIFY( ms.cbegin() != ms.cend() );
-  VERIFY( ms.crbegin() != ms.crend() );  
-}
+#include <testsuite_containers.h>
 
 int main()
 {
-  test01();
+  typedef std::multiset<int> test_type;
+  __gnu_test::citerator<test_type> test;
   return 0;
 }
diff --git a/libstdc++-v3/testsuite/23_containers/multiset/requirements/typedefs.cc b/libstdc++-v3/testsuite/23_containers/multiset/requirements/typedefs.cc
new file mode 100644 (file)
index 0000000..7244003
--- /dev/null
@@ -0,0 +1,25 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <testsuite_containers.h>
+#include <set>
+
+// Check container for required typedefs.
+__gnu_test::types<std::multiset<int> > t;
diff --git a/libstdc++-v3/testsuite/23_containers/priority_queue/requirements/typedefs.cc b/libstdc++-v3/testsuite/23_containers/priority_queue/requirements/typedefs.cc
new file mode 100644 (file)
index 0000000..86fcb0c
--- /dev/null
@@ -0,0 +1,25 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <testsuite_containers.h>
+#include <queue>
+
+// Check container for required typedefs.
+__gnu_test::types<std::priority_queue<int> > t;
diff --git a/libstdc++-v3/testsuite/23_containers/queue/requirements/typedefs.cc b/libstdc++-v3/testsuite/23_containers/queue/requirements/typedefs.cc
new file mode 100644 (file)
index 0000000..7563a2c
--- /dev/null
@@ -0,0 +1,25 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <testsuite_containers.h>
+#include <queue>
+
+// Check container for required typedefs.
+__gnu_test::types<std::queue<int> > t;
index d2cfd4c916556740719c3e71cd9cee2e448c608b..20dd8b9f1e404bd2d47f3b5f4b6dadce7059b1af 100644 (file)
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-
 #include <set>
-#include <testsuite_hooks.h>
-
-void
-test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  std::set<int> s;
-  s.insert(1);
-  VERIFY( s.cbegin() == s.begin() );
-  VERIFY( s.cend() == s.end() );
-  VERIFY( s.crbegin() == s.rbegin() );
-  VERIFY( s.crend() == s.rend() );
-  VERIFY( s.cbegin() != s.cend() );
-  VERIFY( s.crbegin() != s.crend() );  
-}
+#include <testsuite_containers.h>
 
 int main()
 {
-  test01();
+  typedef std::set<int> test_type;
+  __gnu_test::citerator<test_type> test;
   return 0;
 }
diff --git a/libstdc++-v3/testsuite/23_containers/set/requirements/typedefs.cc b/libstdc++-v3/testsuite/23_containers/set/requirements/typedefs.cc
new file mode 100644 (file)
index 0000000..0581e49
--- /dev/null
@@ -0,0 +1,25 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <testsuite_containers.h>
+#include <set>
+
+// Check container for required typedefs.
+__gnu_test::types<std::set<int> > t;
diff --git a/libstdc++-v3/testsuite/23_containers/stack/requirements/typedefs.cc b/libstdc++-v3/testsuite/23_containers/stack/requirements/typedefs.cc
new file mode 100644 (file)
index 0000000..d0f56e5
--- /dev/null
@@ -0,0 +1,25 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <testsuite_containers.h>
+#include <stack>
+
+// Check container for required typedefs.
+__gnu_test::types<std::stack<int> > t;
index b8f9d502a0dc6e501a9d9e89d8ada825c4d1e07b..a00635a568f5aeed3377a1de1286fa1b07fd8c55 100644 (file)
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-
 #include <unordered_map>
-#include <testsuite_hooks.h>
-
-void
-test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  std::unordered_map<int, int> um;
-  um[1] = 1;
-  VERIFY( um.cbegin() == um.begin() );
-  VERIFY( um.cend() == um.end() );
-  VERIFY( um.cbegin() != um.cend() );
-}
+#include <testsuite_containers.h>
 
 int main()
 {
-  test01();
+  typedef std::unordered_map<int, int>  test_type;
+  __gnu_test::citerator<test_type> test;
   return 0;
 }
+
index a6729a314be60e2bbefdb0cd63eba121410760ba..3cad0a16a06cb8fd0ce45eedd9a132c1f8fb3c8b 100644 (file)
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-
 #include <unordered_map>
-#include <testsuite_hooks.h>
-
-// DR 691.
-void test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  typedef std::unordered_map<int, int> um_type;
-  um_type um;
-  um[1] = 1;
-  VERIFY( um.cbegin(0) == um.begin(0) );
-  VERIFY( um.cend(0) == um.end(0) );
-  const um_type::size_type bn = um.bucket(1);
-  VERIFY( um.cbegin(bn) != um.cend(bn) );
-}
+#include <testsuite_containers.h>
 
 int main()
 {
-  test01();
+  typedef std::unordered_map<int, int>         test_type;
+  typedef typename test_type::value_type       value_type;
+  value_type v(1, 1);
+  __gnu_test::forward_members_unordered<test_type> test(v);
   return 0;
 }
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/2.cc
new file mode 100644 (file)
index 0000000..f6b5fe3
--- /dev/null
@@ -0,0 +1,28 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+// This file tests explicit instantiation of library containers
+
+#include <unordered_map>
+#include <testsuite_hooks.h>
+#include <testsuite_api.h>
+
+typedef __gnu_test::NonDefaultConstructible inst_type;
+template class std::unordered_map<inst_type, inst_type>;
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/3.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/3.cc
new file mode 100644 (file)
index 0000000..695fa6f
--- /dev/null
@@ -0,0 +1,24 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <unordered_map>
+
+using namespace std;
+template class unordered_map<int, int, hash<int>, equal_to<int>, allocator<char>>;
index 6985a9b565b83a3301ea84e922a4de28d9dd6216..9b978cebc2000bd56a9310eba00292428cc5fba0 100644 (file)
@@ -1,9 +1,7 @@
-// { dg-do compile }
 // { dg-options "-std=gnu++0x" }
+// { dg-do compile }
 
-// 2008-08-27  Paolo Carlini  <paolo.carlini@oracle.com>
-
-// Copyright (C) 2008, 2009 Free Software Foundation
+// Copyright (C) 2009 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
+#include <testsuite_containers.h>
 #include <unordered_map>
 
-void test01()
-{
-  // Check for required typedefs
-  typedef std::unordered_map<int, int>            test_type;
-
-  typedef test_type::key_type                     key_type;
-  typedef test_type::value_type                   value_type;
-  typedef test_type::mapped_type                  mapped_type;
-  typedef test_type::hasher                       hasher;
-  typedef test_type::key_equal                    key_equal;
-  typedef test_type::allocator_type               allocator_type;
-  typedef test_type::pointer                      pointer;
-  typedef test_type::const_pointer                const_pointer;
-  typedef test_type::reference                    reference;
-  typedef test_type::const_reference              const_reference;
-  typedef test_type::size_type                    size_type;
-  typedef test_type::difference_type              difference_type;
-  typedef test_type::iterator                     iterator;
-  typedef test_type::const_iterator               const_iterator;
-  typedef test_type::local_iterator               local_iterator;
-  typedef test_type::const_local_iterator         const_local_iterator;
-}
+// Check container for required typedefs.
+__gnu_test::types<std::unordered_map<int, long> > t;
index dec0f50027a06b7101a7b487ffbdaa7e850dea3c..736220b73bffffbfdcea598b11d732b1d2a8a359 100644 (file)
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-
 #include <unordered_map>
-#include <testsuite_hooks.h>
-
-void
-test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  typedef std::unordered_multimap<int, int> umm_type;
-  umm_type umm;
-  umm.insert(umm_type::value_type(1, 1));
-  VERIFY( umm.cbegin() == umm.begin() );
-  VERIFY( umm.cend() == umm.end() );
-  VERIFY( umm.cbegin() != umm.cend() );
-}
+#include <testsuite_containers.h>
 
 int main()
 {
-  test01();
+  typedef std::unordered_multimap<int, int> test_type;
+  __gnu_test::citerator<test_type> test;
   return 0;
 }
index d764369bf41064cb1999f39a7f6887c1e4dc8be3..612787cc76381db6d282cc5c63a403ddbb198c79 100644 (file)
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-
 #include <unordered_map>
-#include <testsuite_hooks.h>
-
-// DR 691.
-void test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  typedef std::unordered_multimap<int, int> umm_type;
-  umm_type umm;
-  umm.insert(umm_type::value_type(1, 1));
-  VERIFY( umm.cbegin(0) == umm.begin(0) );
-  VERIFY( umm.cend(0) == umm.end(0) );
-  const umm_type::size_type bn = umm.bucket(1);
-  VERIFY( umm.cbegin(bn) != umm.cend(bn) );
-}
+#include <testsuite_containers.h>
 
 int main()
 {
-  test01();
+  typedef std::unordered_multimap<int, int>    test_type;
+  typedef typename test_type::value_type       value_type;
+  value_type v(1, 1);
+  __gnu_test::forward_members_unordered<test_type> test(v);
   return 0;
 }
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation/2.cc
new file mode 100644 (file)
index 0000000..e26428d
--- /dev/null
@@ -0,0 +1,28 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+// This file tests explicit instantiation of library containers
+
+#include <unordered_map>
+#include <testsuite_hooks.h>
+#include <testsuite_api.h>
+
+typedef __gnu_test::NonDefaultConstructible inst_type;
+template class std::unordered_multimap<inst_type, inst_type>;
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation/3.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation/3.cc
new file mode 100644 (file)
index 0000000..5085f61
--- /dev/null
@@ -0,0 +1,24 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <unordered_map>
+
+using namespace std;
+template class unordered_multimap<int, int, hash<int>, equal_to<int>, allocator<char>>;
index e272e19f2d0f141c7da1612d7b2a973713445a4b..eb1b9157a5cf4749cfd7b2cf4b7f96fc26e029b2 100644 (file)
@@ -1,9 +1,7 @@
-// { dg-do compile }
 // { dg-options "-std=gnu++0x" }
+// { dg-do compile }
 
-// 2008-08-27  Paolo Carlini  <paolo.carlini@oracle.com>
-
-// Copyright (C) 2008, 2009 Free Software Foundation
+// Copyright (C) 2009 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
+#include <testsuite_containers.h>
 #include <unordered_map>
 
-void test01()
-{
-  // Check for required typedefs
-  typedef std::unordered_multimap<int, int>       test_type;
-
-  typedef test_type::key_type                     key_type;
-  typedef test_type::value_type                   value_type;
-  typedef test_type::mapped_type                  mapped_type;
-  typedef test_type::hasher                       hasher;
-  typedef test_type::key_equal                    key_equal;
-  typedef test_type::allocator_type               allocator_type;
-  typedef test_type::pointer                      pointer;
-  typedef test_type::const_pointer                const_pointer;
-  typedef test_type::reference                    reference;
-  typedef test_type::const_reference              const_reference;
-  typedef test_type::size_type                    size_type;
-  typedef test_type::difference_type              difference_type;
-  typedef test_type::iterator                     iterator;
-  typedef test_type::const_iterator               const_iterator;
-  typedef test_type::local_iterator               local_iterator;
-  typedef test_type::const_local_iterator         const_local_iterator;
-}
+// Check container for required typedefs.
+__gnu_test::types<std::unordered_multimap<int, long> > t;
index 0db11958d2e5373f2266d07237d916ff78fd7537..6731848fe6c0a2a7c9509bb364dd94d6b59524c3 100644 (file)
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-
 #include <unordered_set>
-#include <testsuite_hooks.h>
-
-void
-test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  std::unordered_multiset<int> ums;
-  ums.insert(1);
-  VERIFY( ums.cbegin() == ums.begin() );
-  VERIFY( ums.cend() == ums.end() );
-  VERIFY( ums.cbegin() != ums.cend() );
-}
+#include <testsuite_containers.h>
 
 int main()
 {
-  test01();
+  typedef std::unordered_multiset<int> test_type;
+  __gnu_test::citerator<test_type> test;
   return 0;
 }
index ccaf1b677bffb833adddfd50d0d94c76e04fe9ae..c9db47ce5005e2084855f577c1a41e10873a429d 100644 (file)
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-
 #include <unordered_set>
-#include <testsuite_hooks.h>
-
-// DR 691.
-void test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  typedef std::unordered_multiset<int> ums_type;
-  ums_type ums;
-  ums.insert(1);
-  VERIFY( ums.cbegin(0) == ums.begin(0) );
-  VERIFY( ums.cend(0) == ums.end(0) );
-  const ums_type::size_type bn = ums.bucket(1);
-  VERIFY( ums.cbegin(bn) != ums.cend(bn) );
-}
+#include <testsuite_containers.h>
 
 int main()
 {
-  test01();
+  typedef std::unordered_multiset<int>                 test_type;
+  typedef typename test_type::value_type       value_type;
+  value_type v(1);
+  __gnu_test::forward_members_unordered<test_type> test(v);
   return 0;
 }
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/explicit_instantiation/2.cc
new file mode 100644 (file)
index 0000000..d2a120a
--- /dev/null
@@ -0,0 +1,27 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+// This file tests explicit instantiation of library containers
+
+#include <unordered_set>
+#include <testsuite_hooks.h>
+#include <testsuite_api.h>
+
+template class std::unordered_multiset<__gnu_test::NonDefaultConstructible>;
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/explicit_instantiation/3.cc b/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/explicit_instantiation/3.cc
new file mode 100644 (file)
index 0000000..faf119c
--- /dev/null
@@ -0,0 +1,24 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <unordered_set>
+
+using namespace std;
+template class unordered_multiset<int, hash<int>, equal_to<int>, allocator<char>>;
index edd47a325f6fec74d2a3060153bd9b348342d8c0..7e65e3a214ce378bdc86571821a908141329d30e 100644 (file)
@@ -1,9 +1,7 @@
-// { dg-do compile }
 // { dg-options "-std=gnu++0x" }
+// { dg-do compile }
 
-// 2008-08-27  Paolo Carlini  <paolo.carlini@oracle.com>
-
-// Copyright (C) 2008, 2009 Free Software Foundation
+// Copyright (C) 2009 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
+#include <testsuite_containers.h>
 #include <unordered_set>
 
-void test01()
-{
-  // Check for required typedefs
-  typedef std::unordered_multiset<int>            test_type;
-
-  typedef test_type::key_type                     key_type;
-  typedef test_type::value_type                   value_type;
-  typedef test_type::hasher                       hasher;
-  typedef test_type::key_equal                    key_equal;
-  typedef test_type::allocator_type               allocator_type;
-  typedef test_type::pointer                      pointer;
-  typedef test_type::const_pointer                const_pointer;
-  typedef test_type::reference                    reference;
-  typedef test_type::const_reference              const_reference;
-  typedef test_type::size_type                    size_type;
-  typedef test_type::difference_type              difference_type;
-  typedef test_type::iterator                     iterator;
-  typedef test_type::const_iterator               const_iterator;
-  typedef test_type::local_iterator               local_iterator;
-  typedef test_type::const_local_iterator         const_local_iterator;
-}
+// Check container for required typedefs.
+__gnu_test::types<std::unordered_multiset<int> > t;
index 765d99cbf61bb22bebfaf06a1f3fe6828e8b96ca..ce7f79fd69df9d4c7f0a5d2ccc1d12769236faf2 100644 (file)
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-
 #include <unordered_set>
-#include <testsuite_hooks.h>
-
-void
-test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  std::unordered_set<int> us;
-  us.insert(1);
-  VERIFY( us.cbegin() == us.begin() );
-  VERIFY( us.cend() == us.end() );
-  VERIFY( us.cbegin() != us.cend() );
-}
+#include <testsuite_containers.h>
 
 int main()
 {
-  test01();
+  typedef std::unordered_set<int> test_type;
+  __gnu_test::citerator<test_type> test;
   return 0;
 }
index ef356b6ddbda15b2320858ba9eaf4d55a070578b..8abef8c1c9a7a8af817679e7906b7d636a077e42 100644 (file)
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-
 #include <unordered_set>
-#include <testsuite_hooks.h>
-
-// DR 691.
-void test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  typedef std::unordered_set<int> us_type;
-  us_type us;
-  us.insert(1);
-  VERIFY( us.cbegin(0) == us.begin(0) );
-  VERIFY( us.cend(0) == us.end(0) );
-  const us_type::size_type bn = us.bucket(1);
-  VERIFY( us.cbegin(bn) != us.cend(bn) );
-}
+#include <testsuite_containers.h>
 
 int main()
 {
-  test01();
+  typedef std::unordered_set<int>              test_type;
+  typedef typename test_type::value_type       value_type;
+  value_type v(1);
+  __gnu_test::forward_members_unordered<test_type> test(v);
   return 0;
 }
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/explicit_instantiation/2.cc
new file mode 100644 (file)
index 0000000..13e9e37
--- /dev/null
@@ -0,0 +1,27 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+// This file tests explicit instantiation of library containers
+
+#include <unordered_set>
+#include <testsuite_hooks.h>
+#include <testsuite_api.h>
+
+template class std::unordered_set<__gnu_test::NonDefaultConstructible>;
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/explicit_instantiation/3.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/explicit_instantiation/3.cc
new file mode 100644 (file)
index 0000000..7d84ffd
--- /dev/null
@@ -0,0 +1,24 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <unordered_set>
+
+using namespace std;
+template class unordered_set<int, hash<int>, equal_to<int>, allocator<char>>;
index 4ebcb53902994fe37fdafa8518b113edc94bbccc..86983e5a611a69b8842f86613b13af5f820fd8ca 100644 (file)
@@ -1,9 +1,7 @@
-// { dg-do compile }
 // { dg-options "-std=gnu++0x" }
+// { dg-do compile }
 
-// 2008-08-27  Paolo Carlini  <paolo.carlini@oracle.com>
-
-// Copyright (C) 2008, 2009 Free Software Foundation
+// Copyright (C) 2009 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
+#include <testsuite_containers.h>
 #include <unordered_set>
 
-void test01()
-{
-  // Check for required typedefs
-  typedef std::unordered_set<int>                 test_type;
-
-  typedef test_type::key_type                     key_type;
-  typedef test_type::value_type                   value_type;
-  typedef test_type::hasher                       hasher;
-  typedef test_type::key_equal                    key_equal;
-  typedef test_type::allocator_type               allocator_type;
-  typedef test_type::pointer                      pointer;
-  typedef test_type::const_pointer                const_pointer;
-  typedef test_type::reference                    reference;
-  typedef test_type::const_reference              const_reference;
-  typedef test_type::size_type                    size_type;
-  typedef test_type::difference_type              difference_type;
-  typedef test_type::iterator                     iterator;
-  typedef test_type::const_iterator               const_iterator;
-  typedef test_type::local_iterator               local_iterator;
-  typedef test_type::const_local_iterator         const_local_iterator;
-}
+// Check container for required typedefs.
+__gnu_test::types<std::unordered_set<int> > t;
index b5eaebb65251d01e2971ac0d7d1e759d4685af33..9f4783b743933e3dc904fb2e888a1db8c0ff87f2 100644 (file)
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-
 #include <vector>
-#include <testsuite_hooks.h>
-
-void
-test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  std::vector<bool> vb(7);
-  VERIFY( vb.cbegin() == vb.begin() );
-  VERIFY( vb.cend() == vb.end() );
-  VERIFY( vb.crbegin() == vb.rbegin() );
-  VERIFY( vb.crend() == vb.rend() );
-  VERIFY( vb.cbegin() != vb.cend() );
-  VERIFY( vb.crbegin() != vb.crend() );  
-}
+#include <testsuite_containers.h>
 
 int main()
 {
-  test01();
+  typedef std::vector<bool> test_type;
+  __gnu_test::citerator<test_type> test;
   return 0;
 }
index c9a07a1ed756e08b486fb6ef82f2c9391979abf2..eee16b04ed64428e53b5a558521364415b67961b 100644 (file)
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-
 #include <vector>
-#include <testsuite_hooks.h>
-
-void
-test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  std::vector<int> v(7);
-  VERIFY( v.cbegin() == v.begin() );
-  VERIFY( v.cend() == v.end() );
-  VERIFY( v.crbegin() == v.rbegin() );
-  VERIFY( v.crend() == v.rend() );
-  VERIFY( v.cbegin() != v.cend() );
-  VERIFY( v.crbegin() != v.crend() );  
-}
+#include <testsuite_containers.h>
 
 int main()
 {
-  test01();
+  typedef std::vector<int> test_type;
+  __gnu_test::citerator<test_type> test;
   return 0;
 }
diff --git a/libstdc++-v3/testsuite/23_containers/vector/requirements/typedefs.cc b/libstdc++-v3/testsuite/23_containers/vector/requirements/typedefs.cc
new file mode 100644 (file)
index 0000000..24897ff
--- /dev/null
@@ -0,0 +1,25 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <testsuite_containers.h>
+#include <vector>
+
+// Check container for required typedefs.
+__gnu_test::types<std::vector<int> > t;
index 125cefd7109a0a1734ae46738afa0c5e94d4660a..582cadac338e683b78f5ff4cc5392a4f8b71e283 100644 (file)
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-
 #include <ext/vstring.h>
-#include <testsuite_hooks.h>
-
-void
-test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  __gnu_cxx::__vstring v(7, 'a');
-  VERIFY( v.cbegin() == v.begin() );
-  VERIFY( v.cend() == v.end() );
-  VERIFY( v.crbegin() == v.rbegin() );
-  VERIFY( v.crend() == v.rend() );
-  VERIFY( v.cbegin() != v.cend() );
-  VERIFY( v.crbegin() != v.crend() );  
-}
+#include <testsuite_containers.h>
 
 int main()
 {
-  test01();
+  typedef __gnu_cxx::__vstring  test_type;
+  __gnu_test::citerator<test_type> test;
   return 0;
 }
diff --git a/libstdc++-v3/testsuite/ext/vstring/requirements/typedefs.cc b/libstdc++-v3/testsuite/ext/vstring/requirements/typedefs.cc
new file mode 100644 (file)
index 0000000..06db6af
--- /dev/null
@@ -0,0 +1,25 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <testsuite_containers.h>
+#include <ext/vstring.h>
+
+// Check container for required typedefs.
+__gnu_test::types<__gnu_cxx::__vstring> t;
diff --git a/libstdc++-v3/testsuite/util/testsuite_container_traits.h b/libstdc++-v3/testsuite/util/testsuite_container_traits.h
new file mode 100644 (file)
index 0000000..7c4b1a2
--- /dev/null
@@ -0,0 +1,207 @@
+// -*- C++ -*-
+
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#ifndef _GLIBCXX_TESTSUITE_CONTAINER_TRAITS_H
+#define _GLIBCXX_TESTSUITE_CONTAINER_TRAITS_H
+
+#include <bits/stdc++.h>
+#include <ext/vstring.h>
+
+namespace __gnu_test
+{  
+  // Container traits.
+  struct traits_base
+  {
+    // Type, nested type, and typedef related traits.
+    typedef std::false_type    is_container;
+    typedef std::false_type    is_adaptor;
+    typedef std::false_type    is_reversible;
+    typedef std::false_type    is_allocator_aware;
+    typedef std::false_type    is_pointer_aware;
+    typedef std::false_type    is_associative;
+    typedef std::false_type    is_unordered;
+    typedef std::false_type    is_mapped;
+  };
+
+  // Primary template does nothing. Specialize on each type under
+  // test, derive off of traits_base and just add the true traits.
+  template<typename _Tp>
+    struct traits;
+
+  // Specialize for each container.
+  template<typename _Tp, size_t _Np>
+    struct traits<std::array<_Tp, _Np> > : public traits_base
+    {
+      typedef std::true_type   is_container;
+      typedef std::true_type   is_reversible;
+    };
+
+  template<typename _Tp>
+    struct traits<std::deque<_Tp> > : public traits_base
+    {
+      typedef std::true_type   is_container;
+      typedef std::true_type   is_reversible;
+      typedef std::true_type   is_allocator_aware;
+      typedef std::true_type   is_pointer_aware;
+    };
+
+  template<typename _Tp>
+    struct traits<std::forward_list<_Tp> > : public traits_base
+    {
+      typedef std::true_type   is_container;
+      typedef std::true_type   is_allocator_aware;
+      typedef std::true_type   is_pointer_aware;
+    };
+
+  template<typename _Tp>
+    struct traits<std::list<_Tp> > : public traits_base
+    {
+      typedef std::true_type   is_container;
+      typedef std::true_type   is_reversible;
+      typedef std::true_type   is_allocator_aware;
+      typedef std::true_type   is_pointer_aware;
+    };
+
+  template<typename _Kp, typename _Tp>
+    struct traits<std::map<_Kp, _Tp> > : public traits_base
+    {
+      typedef std::true_type   is_container;
+      typedef std::true_type   is_reversible;
+      typedef std::true_type   is_allocator_aware;
+      typedef std::true_type   is_pointer_aware;
+      typedef std::true_type   is_associative;
+      typedef std::true_type   is_mapped;
+    };
+
+  template<typename _Kp, typename _Tp>
+    struct traits<std::multimap<_Kp, _Tp> > : public traits_base
+    {
+      typedef std::true_type   is_container;
+      typedef std::true_type   is_reversible;
+      typedef std::true_type   is_allocator_aware;
+      typedef std::true_type   is_pointer_aware;
+      typedef std::true_type   is_associative;
+      typedef std::true_type   is_mapped;
+    };
+
+  template<typename _Tp>
+    struct traits<std::multiset<_Tp> > : public traits_base
+    {
+      typedef std::true_type   is_container;
+      typedef std::true_type   is_reversible;
+      typedef std::true_type   is_allocator_aware;
+      typedef std::true_type   is_pointer_aware;
+      typedef std::true_type   is_associative;
+    };
+
+  template<typename _Tp>
+    struct traits<std::priority_queue<_Tp> > : public traits_base
+    {
+      typedef std::true_type   is_adaptor;
+    };
+
+  template<typename _Tp>
+    struct traits<std::queue<_Tp> > : public traits_base
+    {
+      typedef std::true_type   is_adaptor;
+    };
+
+  template<typename _Tp>
+    struct traits<std::set<_Tp> > : public traits_base
+    {
+      typedef std::true_type   is_container;
+      typedef std::true_type   is_reversible;
+      typedef std::true_type   is_allocator_aware;
+      typedef std::true_type   is_pointer_aware;
+      typedef std::true_type   is_associative;
+    };
+
+  template<typename _Tp>
+    struct traits<std::stack<_Tp> > : public traits_base
+    {
+      typedef std::true_type   is_adaptor;
+    };
+
+  template<typename _Kp, typename _Tp>
+    struct traits<std::unordered_map<_Kp, _Tp> > : public traits_base
+    {
+      typedef std::true_type   is_container;
+      typedef std::true_type   is_allocator_aware;
+      typedef std::true_type   is_pointer_aware;
+      typedef std::true_type   is_unordered;
+      typedef std::true_type   is_mapped;
+    };
+
+  template<typename _Kp, typename _Tp>
+    struct traits<std::unordered_multimap<_Kp, _Tp> > : public traits_base
+    {
+      typedef std::true_type   is_container;
+      typedef std::true_type   is_allocator_aware;
+      typedef std::true_type   is_pointer_aware;
+      typedef std::true_type   is_unordered;
+      typedef std::true_type   is_mapped;
+    };
+
+  template<typename _Tp>
+    struct traits<std::unordered_multiset<_Tp> > : public traits_base
+    {
+      typedef std::true_type   is_container;
+      typedef std::true_type   is_allocator_aware;
+      typedef std::true_type   is_pointer_aware;
+      typedef std::true_type   is_unordered;
+    };
+
+  template<typename _Tp>
+    struct traits<std::unordered_set<_Tp> > : public traits_base
+    {
+      typedef std::true_type   is_container;
+      typedef std::true_type   is_allocator_aware;
+      typedef std::true_type   is_pointer_aware;
+      typedef std::true_type   is_unordered;
+    };
+
+  template<typename _Tp>
+    struct traits<std::vector<_Tp> > : public traits_base
+    {
+      typedef std::true_type    is_container;
+      typedef std::true_type    is_reversible;
+      typedef std::true_type    is_allocator_aware;
+      typedef std::true_type    is_pointer_aware;
+    };
+
+  template<typename _Tp>
+    struct traits<std::basic_string<_Tp> > : public traits_base
+    {
+      typedef std::true_type    is_container;
+      typedef std::true_type    is_reversible;
+      typedef std::true_type    is_allocator_aware;
+      typedef std::true_type    is_pointer_aware;
+    };
+
+  template<typename _Tp>
+    struct traits<__gnu_cxx::__versa_string<_Tp> > : public traits_base
+    {
+      typedef std::true_type    is_container;
+      typedef std::true_type    is_reversible;
+      typedef std::true_type    is_allocator_aware;
+      typedef std::true_type    is_pointer_aware;
+    };
+} // namespace __gnu_test
+
+#endif 
diff --git a/libstdc++-v3/testsuite/util/testsuite_containers.h b/libstdc++-v3/testsuite/util/testsuite_containers.h
new file mode 100644 (file)
index 0000000..62bf38f
--- /dev/null
@@ -0,0 +1,238 @@
+// -*- C++ -*-
+
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#ifndef _GLIBCXX_TESTSUITE_CONTAINERS_H
+#define _GLIBCXX_TESTSUITE_CONTAINERS_H
+
+#include <cassert>
+#include <testsuite_container_traits.h>
+
+// Container requirement testing.
+namespace __gnu_test
+{
+  // Compile-time typedef testing.
+  template<typename _Tp, bool _Bt = traits<_Tp>::is_container::value>
+    struct basic_types
+    {
+      // Base container requirements (table 80)
+      typedef _Tp                                      test_type;
+      typedef typename test_type::value_type           value_type;
+      typedef typename test_type::reference            reference;
+      typedef typename test_type::const_reference      const_reference;
+      typedef typename test_type::iterator             iterator;
+      typedef typename test_type::const_iterator       const_iterator;
+      typedef typename test_type::size_type            size_type;
+      typedef typename test_type::difference_type      difference_type;
+    };
+
+  // Conditional typedef testing, positive.
+  template<typename _Tp, bool _Bt = traits<_Tp>::is_reversible::value>
+    struct reversible_types
+    {
+      // Reversible container requirements (table 81)
+      typedef _Tp                                       test_type;
+      typedef typename test_type::reverse_iterator      reverse_iterator;
+      typedef typename test_type::const_reverse_iterator const_reverse_iterator;
+    };
+
+  template<typename _Tp, bool _Bt = traits<_Tp>::is_allocator_aware::value>
+    struct allocator_aware_types
+    {
+      // Allocator-aware requirements (table 82)
+      typedef _Tp                                       test_type;
+      typedef typename test_type::allocator_type        allocator_type;
+    };
+
+  template<typename _Tp, bool _Bt = traits<_Tp>::is_pointer_aware::value>
+    struct pointer_aware_types
+    {
+      // Allocator-aware requirements (table 82)
+      typedef _Tp                                       test_type;
+      typedef typename test_type::pointer               pointer;
+      typedef typename test_type::const_pointer                 const_pointer;
+    };
+
+  template<typename _Tp, bool _Bt = traits<_Tp>::is_associative::value>
+    struct associative_types
+    {
+      // Associative container requirements (table 85)
+      typedef _Tp                                       test_type;
+      typedef typename test_type::key_type              key_type;
+      typedef typename test_type::key_compare           key_compare;
+      typedef typename test_type::value_compare                 value_compare;
+    };
+
+  template<typename _Tp, bool = traits<_Tp>::is_unordered::value>
+    struct unordered_types
+    {
+      // Unordered associative container requirements (table 87)
+      typedef _Tp                                       test_type;
+      typedef typename test_type::key_type              key_type;
+      typedef typename test_type::hasher                hasher;
+      typedef typename test_type::key_equal             key_equal;
+      typedef typename test_type::local_iterator        local_iterator;
+      typedef typename test_type::const_local_iterator  const_local_iterator;
+    };
+
+  template<typename _Tp, bool _Bt = traits<_Tp>::is_mapped::value>
+    struct mapped_types
+    {
+      typedef _Tp                                       test_type;
+      typedef typename test_type::mapped_type           mapped_type;
+    };
+
+  template<typename _Tp, bool = traits<_Tp>::is_adaptor::value>
+    struct adaptor_types
+    {
+      // Container adaptor requirements.
+      typedef _Tp                                      test_type;
+      typedef typename test_type::value_type           value_type;
+      typedef typename test_type::reference            reference;
+      typedef typename test_type::const_reference      const_reference;
+      typedef typename test_type::size_type            size_type;
+      typedef typename test_type::container_type       container_type;
+    };
+
+  // Conditional typedef testing, negative.
+  template<typename _Tp>
+    struct basic_types<_Tp, false> { };
+
+  template<typename _Tp>
+    struct reversible_types<_Tp, false> { };
+
+  template<typename _Tp>
+    struct allocator_aware_types<_Tp, false> { };
+
+  template<typename _Tp>
+    struct pointer_aware_types<_Tp, false> { };
+
+  template<typename _Tp>
+    struct associative_types<_Tp, false> { };
+
+  template<typename _Tp>
+    struct unordered_types<_Tp, false> { };
+
+  template<typename _Tp>
+    struct mapped_types<_Tp, false> { };
+
+  template<typename _Tp>
+    struct adaptor_types<_Tp, false> { };
+
+  // Primary template.
+  template<typename _Tp>
+    struct types
+    : basic_types<_Tp>, adaptor_types<_Tp>, reversible_types<_Tp>,
+      allocator_aware_types<_Tp>, pointer_aware_types<_Tp>,
+      associative_types<_Tp>, unordered_types<_Tp>, mapped_types<_Tp>
+    { };
+
+
+  // Run-time test for constant_iterator requirements.
+  template<typename _Tp, bool = traits<_Tp>::is_allocator_aware::value>
+    struct populate
+    {
+      populate(_Tp& container)
+      {
+       typename _Tp::value_type v;
+       container.insert(container.begin(), v);
+       container.insert(container.begin(), v);
+      }
+  };
+
+  template<typename _Tp>
+    struct populate<_Tp, false>
+    {
+      populate(_Tp& container) { }
+    };
+
+  template<typename _Tp, bool = traits<_Tp>::is_reversible::value>
+    struct reverse_members
+    {
+      reverse_members(_Tp& container)
+      {
+       assert( container.crbegin() == container.rbegin() );
+       assert( container.crend() == container.rend() );
+       assert( container.crbegin() != container.crend() );
+      }
+    };
+
+  template<typename _Tp>
+    struct reverse_members<_Tp, false>
+    {
+      reverse_members(_Tp& container) { }
+    };
+
+  // DR 691.
+  template<typename _Tp, bool = traits<_Tp>::is_unordered::value>
+    struct forward_members_unordered
+    {
+      forward_members_unordered(typename _Tp::value_type& v)
+      {
+       typedef _Tp                                     test_type;
+       test_type container;
+       container.insert(v);
+       assert( container.cbegin(0) == container.begin(0) );
+       assert( container.cend(0) == container.end(0) );
+       const typename test_type::size_type bn = container.bucket(1);
+       assert( container.cbegin(bn) != container.cend(bn) );
+      }
+    };
+
+  template<typename _Tp>
+    struct forward_members_unordered<_Tp, false>
+    {
+      forward_members_unordered(_Tp& container) { }
+    };
+
+  template<typename _Tp>
+    struct citerator
+    {
+      typedef _Tp                                      test_type;
+      typedef traits<test_type>                                traits_type;
+      typedef typename test_type::value_type           value_type;
+
+      static test_type _S_container;
+
+      // Unconditional.
+      struct forward_members
+      {
+       forward_members()
+       {
+         assert( _S_container.cbegin() == _S_container.begin() );
+         assert( _S_container.cend() == _S_container.end() );
+         assert( _S_container.cbegin() != _S_container.cend() );
+       }
+      };
+
+      // Run test.
+      citerator()
+      {
+       populate<test_type> p(_S_container);
+       forward_members m1;
+       reverse_members<test_type> m2(_S_container);
+      }
+  };
+
+  template<typename _Tp>
+  _Tp citerator<_Tp>::_S_container;
+
+
+} // namespace __gnu_test
+
+#endif