From 43308b7e11b2c491063a4670effa18588b07037f Mon Sep 17 00:00:00 2001 From: bkoz Date: Tue, 25 Aug 2009 22:29:08 +0000 Subject: [PATCH] 2009-08-25 Benjamin Kosnik * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@151106 138bc75d-0d04-0410-961f-82ee72b054a4 --- libstdc++-v3/ChangeLog | 123 ++++++++++- libstdc++-v3/config/abi/pre/gnu.ver | 21 +- libstdc++-v3/include/bits/basic_string.h | 36 ++++ .../basic_string/requirements/citerators.cc | 29 +++ .../basic_string/requirements/typedefs.cc | 26 +++ .../23_containers/array/requirements/citerators.cc | 20 +- .../1.cc} | 1 - .../array/requirements/explicit_instantiation/2.cc | 27 +++ .../23_containers/array/requirements/typedefs.cc | 25 +++ .../23_containers/deque/requirements/citerators.cc | 20 +- .../23_containers/deque/requirements/typedefs.cc | 25 +++ .../23_containers/forward_list/requirements/1.cc | 69 ------ .../forward_list/requirements/citerators.cc | 41 ++++ .../forward_list/requirements/dr438/assign_neg.cc | 35 +++ .../forward_list/requirements/dr438/constructor.cc | 27 +++ .../requirements/dr438/constructor_1_neg.cc | 29 +++ .../requirements/dr438/constructor_2_neg.cc | 30 +++ .../forward_list/requirements/dr438/insert_neg.cc | 35 +++ .../forward_list/requirements/typedefs.cc | 25 +++ .../23_containers/list/requirements/citerators.cc | 22 +- .../23_containers/list/requirements/typedefs.cc | 25 +++ .../23_containers/map/requirements/citerators.cc | 21 +- .../23_containers/map/requirements/typedefs.cc | 25 +++ .../multimap/requirements/citerators.cc | 22 +- .../multimap/requirements/typedefs.cc | 25 +++ .../multiset/requirements/citerators.cc | 21 +- .../multiset/requirements/typedefs.cc | 25 +++ .../priority_queue/requirements/typedefs.cc | 25 +++ .../23_containers/queue/requirements/typedefs.cc | 25 +++ .../23_containers/set/requirements/citerators.cc | 21 +- .../23_containers/set/requirements/typedefs.cc | 25 +++ .../23_containers/stack/requirements/typedefs.cc | 25 +++ .../unordered_map/requirements/citerators.cc | 19 +- .../unordered_map/requirements/cliterators.cc | 22 +- .../1.cc} | 0 .../requirements/explicit_instantiation/2.cc | 28 +++ .../requirements/explicit_instantiation/3.cc | 24 +++ .../unordered_map/requirements/typedefs.cc | 31 +-- .../unordered_multimap/requirements/citerators.cc | 19 +- .../unordered_multimap/requirements/cliterators.cc | 22 +- .../1.cc} | 0 .../requirements/explicit_instantiation/2.cc | 28 +++ .../requirements/explicit_instantiation/3.cc | 24 +++ .../unordered_multimap/requirements/typedefs.cc | 31 +-- .../unordered_multiset/requirements/citerators.cc | 18 +- .../unordered_multiset/requirements/cliterators.cc | 22 +- .../1.cc} | 0 .../requirements/explicit_instantiation/2.cc | 27 +++ .../requirements/explicit_instantiation/3.cc | 24 +++ .../unordered_multiset/requirements/typedefs.cc | 30 +-- .../unordered_set/requirements/citerators.cc | 18 +- .../unordered_set/requirements/cliterators.cc | 22 +- .../1.cc} | 0 .../requirements/explicit_instantiation/2.cc | 27 +++ .../requirements/explicit_instantiation/3.cc | 24 +++ .../unordered_set/requirements/typedefs.cc | 30 +-- .../vector/bool/requirements/citerators.cc | 20 +- .../requirements/dr438}/constructor.cc | 0 .../vector/requirements/citerators.cc | 20 +- .../23_containers/vector/requirements/typedefs.cc | 25 +++ .../ext/vstring/requirements/citerators.cc | 20 +- .../testsuite/ext/vstring/requirements/typedefs.cc | 25 +++ .../testsuite/util/testsuite_container_traits.h | 207 ++++++++++++++++++ libstdc++-v3/testsuite/util/testsuite_containers.h | 238 +++++++++++++++++++++ 64 files changed, 1509 insertions(+), 487 deletions(-) create mode 100644 libstdc++-v3/testsuite/21_strings/basic_string/requirements/citerators.cc create mode 100644 libstdc++-v3/testsuite/21_strings/basic_string/requirements/typedefs.cc rename libstdc++-v3/testsuite/23_containers/array/requirements/{explicit_instantiation.cc => explicit_instantiation/1.cc} (99%) create mode 100644 libstdc++-v3/testsuite/23_containers/array/requirements/explicit_instantiation/2.cc create mode 100644 libstdc++-v3/testsuite/23_containers/array/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/23_containers/deque/requirements/typedefs.cc delete mode 100644 libstdc++-v3/testsuite/23_containers/forward_list/requirements/1.cc create mode 100644 libstdc++-v3/testsuite/23_containers/forward_list/requirements/citerators.cc create mode 100644 libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/assign_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor.cc create mode 100644 libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/insert_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/forward_list/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/23_containers/list/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/23_containers/map/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/23_containers/multimap/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/23_containers/multiset/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/23_containers/priority_queue/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/23_containers/queue/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/23_containers/set/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/23_containers/stack/requirements/typedefs.cc rename libstdc++-v3/testsuite/23_containers/unordered_map/requirements/{explicit_instantiation.cc => explicit_instantiation/1.cc} (100%) create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/2.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/3.cc rename libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/{explicit_instantiation.cc => explicit_instantiation/1.cc} (100%) create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation/2.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation/3.cc rename libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/{explicit_instantiation.cc => explicit_instantiation/1.cc} (100%) create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/explicit_instantiation/2.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/explicit_instantiation/3.cc rename libstdc++-v3/testsuite/23_containers/unordered_set/requirements/{explicit_instantiation.cc => explicit_instantiation/1.cc} (100%) create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_set/requirements/explicit_instantiation/2.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_set/requirements/explicit_instantiation/3.cc rename libstdc++-v3/testsuite/23_containers/vector/{requirements/dr438/bool => bool/requirements/dr438}/constructor.cc (100%) create mode 100644 libstdc++-v3/testsuite/23_containers/vector/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/ext/vstring/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/util/testsuite_container_traits.h create mode 100644 libstdc++-v3/testsuite/util/testsuite_containers.h diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 26759a4..cd892b2 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,112 @@ +2009-08-25 Benjamin Kosnik + + * 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 * configure.ac (AC_PREREQ): Bump to 2.64. @@ -76,7 +185,7 @@ 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<>&), @@ -257,12 +366,12 @@ 2009-08-06 Benjamin Kosnik * 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 @@ -1105,7 +1214,7 @@ 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() diff --git a/libstdc++-v3/config/abi/pre/gnu.ver b/libstdc++-v3/config/abi/pre/gnu.ver index c4967db..e73b5fe 100644 --- a/libstdc++-v3/config/abi/pre/gnu.ver +++ b/libstdc++-v3/config/abi/pre/gnu.ver @@ -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. diff --git a/libstdc++-v3/include/bits/basic_string.h b/libstdc++-v3/include/bits/basic_string.h index 085aea4..bd54537 100644 --- a/libstdc++-v3/include/bits/basic_string.h +++ b/libstdc++-v3/include/bits/basic_string.h @@ -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 index 0000000..fe262b0 --- /dev/null +++ b/libstdc++-v3/testsuite/21_strings/basic_string/requirements/citerators.cc @@ -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 +// . + +#include +#include + +int main() +{ + __gnu_test::citerator test1; + __gnu_test::citerator 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 index 0000000..aa0ac08 --- /dev/null +++ b/libstdc++-v3/testsuite/21_strings/basic_string/requirements/typedefs.cc @@ -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 +// . + +#include +#include + +// Check container for required typedefs. +__gnu_test::types t1; +__gnu_test::types t2; diff --git a/libstdc++-v3/testsuite/23_containers/array/requirements/citerators.cc b/libstdc++-v3/testsuite/23_containers/array/requirements/citerators.cc index 0597dcf..c448a84 100644 --- a/libstdc++-v3/testsuite/23_containers/array/requirements/citerators.cc +++ b/libstdc++-v3/testsuite/23_containers/array/requirements/citerators.cc @@ -19,26 +19,12 @@ // with this library; see the file COPYING3. If not see // . - #include -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - std::array 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 int main() { - test01(); + typedef std::array test_type; + __gnu_test::citerator test; return 0; } diff --git a/libstdc++-v3/testsuite/23_containers/array/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/23_containers/array/requirements/explicit_instantiation/1.cc 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 75fcb3c..0e10441 100644 --- a/libstdc++-v3/testsuite/23_containers/array/requirements/explicit_instantiation.cc +++ b/libstdc++-v3/testsuite/23_containers/array/requirements/explicit_instantiation/1.cc @@ -18,7 +18,6 @@ // along with this library; see the file COPYING3. If not see // . - #include template class std::array; 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 index 0000000..aadf76b --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/array/requirements/explicit_instantiation/2.cc @@ -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 +// . + +// This file tests explicit instantiation of library containers + +#include +#include +#include + +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 index 0000000..152988d --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/array/requirements/typedefs.cc @@ -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 +// . + +#include +#include + +// Check container for required typedefs. +__gnu_test::types > t; diff --git a/libstdc++-v3/testsuite/23_containers/deque/requirements/citerators.cc b/libstdc++-v3/testsuite/23_containers/deque/requirements/citerators.cc index dd4179d..4a05e60 100644 --- a/libstdc++-v3/testsuite/23_containers/deque/requirements/citerators.cc +++ b/libstdc++-v3/testsuite/23_containers/deque/requirements/citerators.cc @@ -19,26 +19,12 @@ // with this library; see the file COPYING3. If not see // . - #include -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - std::deque 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 int main() { - test01(); + typedef std::deque test_type; + __gnu_test::citerator 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 index 0000000..6263951 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/deque/requirements/typedefs.cc @@ -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 +// . + +#include +#include + +// Check container for required typedefs. +__gnu_test::types > 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 index 67aa70b..0000000 --- a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/1.cc +++ /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 -// . - -// 23.2.3.n forward_list xxx [lib.forward_list.xxx] - -#include -#include - -bool test __attribute__((unused)) = true; - -// A nontrivial type. -template - 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 > 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 >::reference reference; - typedef std::forward_list< A >::const_reference const_reference; - typedef std::forward_list< A >::iterator iterator; - typedef std::forward_list< A >::const_iterator const_iterator; - typedef std::forward_list< A >::size_type size_type; - typedef std::forward_list< A >::difference_type difference_type; - typedef std::forward_list< A >::value_type value_type; - typedef std::forward_list< A >::allocator_type allocator_type; - typedef std::forward_list< A >::pointer pointer; - typedef std::forward_list< A >::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 index 0000000..86fa26e --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/citerators.cc @@ -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 +// . + +#include +#include + +namespace __gnu_test +{ + template<> + struct populate, true> + { + populate(std::forward_list& container) + { + container.push_front(1); + container.push_front(2); + } + }; +} + +int main() +{ + typedef std::forward_list test_type; + __gnu_test::citerator 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 index 0000000..93f0e6d --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/assign_neg.cc @@ -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 +// . + +#include + +struct A +{ + explicit A(int) { } +}; + +void f() +{ + typedef std::forward_list 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 index 0000000..407d8d1 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor.cc @@ -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 +// . + +#include + +void f() +{ + typedef std::forward_list 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 index 0000000..70d0447 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_1_neg.cc @@ -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 +// . + +#include + +void f() +{ + typedef std::forward_list > 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 index 0000000..2ee8b9f --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_2_neg.cc @@ -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 +// . + +#include +#include + +void f() +{ + typedef std::forward_list > > 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 index 0000000..a21c222 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/insert_neg.cc @@ -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 +// . + +#include + +struct A +{ + explicit A(int) { } +}; + +void f() +{ + typedef std::forward_list 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 index 0000000..3497b09 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/typedefs.cc @@ -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 +// . + +#include +#include + +// Check container for required typedefs. +__gnu_test::types > t; diff --git a/libstdc++-v3/testsuite/23_containers/list/requirements/citerators.cc b/libstdc++-v3/testsuite/23_containers/list/requirements/citerators.cc index 6bcffbb..ac5bdec 100644 --- a/libstdc++-v3/testsuite/23_containers/list/requirements/citerators.cc +++ b/libstdc++-v3/testsuite/23_containers/list/requirements/citerators.cc @@ -19,28 +19,12 @@ // with this library; see the file COPYING3. If not see // . - #include -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - typedef std::list 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 int main() { - test01(); + typedef std::list test_type; + __gnu_test::citerator 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 index 0000000..444ebb5 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/list/requirements/typedefs.cc @@ -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 +// . + +#include +#include + +// Check container for required typedefs. +__gnu_test::types > t; diff --git a/libstdc++-v3/testsuite/23_containers/map/requirements/citerators.cc b/libstdc++-v3/testsuite/23_containers/map/requirements/citerators.cc index 05e10aa..17db1e7 100644 --- a/libstdc++-v3/testsuite/23_containers/map/requirements/citerators.cc +++ b/libstdc++-v3/testsuite/23_containers/map/requirements/citerators.cc @@ -19,27 +19,12 @@ // with this library; see the file COPYING3. If not see // . - #include -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - std::map 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 int main() { - test01(); + typedef std::map test_type; + __gnu_test::citerator 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 index 0000000..1325cc6 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/map/requirements/typedefs.cc @@ -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 +// . + +#include +#include + +// Check container for required typedefs. +__gnu_test::types > t; diff --git a/libstdc++-v3/testsuite/23_containers/multimap/requirements/citerators.cc b/libstdc++-v3/testsuite/23_containers/multimap/requirements/citerators.cc index 2daa885..15773cb 100644 --- a/libstdc++-v3/testsuite/23_containers/multimap/requirements/citerators.cc +++ b/libstdc++-v3/testsuite/23_containers/multimap/requirements/citerators.cc @@ -19,28 +19,12 @@ // with this library; see the file COPYING3. If not see // . - #include -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - typedef std::multimap 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 int main() { - test01(); + typedef std::multimap test_type; + __gnu_test::citerator 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 index 0000000..38a4bc5 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/multimap/requirements/typedefs.cc @@ -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 +// . + +#include +#include + +// Check container for required typedefs. +__gnu_test::types > t; diff --git a/libstdc++-v3/testsuite/23_containers/multiset/requirements/citerators.cc b/libstdc++-v3/testsuite/23_containers/multiset/requirements/citerators.cc index 2efd054..bf3aa16 100644 --- a/libstdc++-v3/testsuite/23_containers/multiset/requirements/citerators.cc +++ b/libstdc++-v3/testsuite/23_containers/multiset/requirements/citerators.cc @@ -19,27 +19,12 @@ // with this library; see the file COPYING3. If not see // . - #include -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - std::multiset 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 int main() { - test01(); + typedef std::multiset test_type; + __gnu_test::citerator 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 index 0000000..7244003 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/multiset/requirements/typedefs.cc @@ -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 +// . + +#include +#include + +// Check container for required typedefs. +__gnu_test::types > 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 index 0000000..86fcb0c --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/priority_queue/requirements/typedefs.cc @@ -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 +// . + +#include +#include + +// Check container for required typedefs. +__gnu_test::types > 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 index 0000000..7563a2c --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/queue/requirements/typedefs.cc @@ -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 +// . + +#include +#include + +// Check container for required typedefs. +__gnu_test::types > t; diff --git a/libstdc++-v3/testsuite/23_containers/set/requirements/citerators.cc b/libstdc++-v3/testsuite/23_containers/set/requirements/citerators.cc index d2cfd4c..20dd8b9 100644 --- a/libstdc++-v3/testsuite/23_containers/set/requirements/citerators.cc +++ b/libstdc++-v3/testsuite/23_containers/set/requirements/citerators.cc @@ -19,27 +19,12 @@ // with this library; see the file COPYING3. If not see // . - #include -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - std::set 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 int main() { - test01(); + typedef std::set test_type; + __gnu_test::citerator 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 index 0000000..0581e49 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/set/requirements/typedefs.cc @@ -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 +// . + +#include +#include + +// Check container for required typedefs. +__gnu_test::types > 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 index 0000000..d0f56e5 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/stack/requirements/typedefs.cc @@ -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 +// . + +#include +#include + +// Check container for required typedefs. +__gnu_test::types > t; diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/citerators.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/citerators.cc index b8f9d50..a00635a 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/citerators.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/citerators.cc @@ -19,24 +19,13 @@ // with this library; see the file COPYING3. If not see // . - #include -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - std::unordered_map um; - um[1] = 1; - VERIFY( um.cbegin() == um.begin() ); - VERIFY( um.cend() == um.end() ); - VERIFY( um.cbegin() != um.cend() ); -} +#include int main() { - test01(); + typedef std::unordered_map test_type; + __gnu_test::citerator test; return 0; } + diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/cliterators.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/cliterators.cc index a6729a3..3cad0a1 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/cliterators.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/cliterators.cc @@ -19,26 +19,14 @@ // with this library; see the file COPYING3. If not see // . - #include -#include - -// DR 691. -void test01() -{ - bool test __attribute__((unused)) = true; - - typedef std::unordered_map 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 int main() { - test01(); + typedef std::unordered_map test_type; + typedef typename test_type::value_type value_type; + value_type v(1, 1); + __gnu_test::forward_members_unordered test(v); return 0; } diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/1.cc similarity index 100% rename from libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation.cc rename to libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/1.cc 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 index 0000000..f6b5fe3 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/2.cc @@ -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 +// . + +// This file tests explicit instantiation of library containers + +#include +#include +#include + +typedef __gnu_test::NonDefaultConstructible inst_type; +template class std::unordered_map; 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 index 0000000..695fa6f --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/3.cc @@ -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 +// . + +#include + +using namespace std; +template class unordered_map, equal_to, allocator>; diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/typedefs.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/typedefs.cc index 6985a9b..9b978ce 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/typedefs.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/typedefs.cc @@ -1,9 +1,7 @@ -// { dg-do compile } // { dg-options "-std=gnu++0x" } +// { dg-do compile } -// 2008-08-27 Paolo Carlini - -// 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 @@ -20,27 +18,8 @@ // with this library; see the file COPYING3. If not see // . +#include #include -void test01() -{ - // Check for required typedefs - typedef std::unordered_map 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 > t; diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/citerators.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/citerators.cc index dec0f50..736220b 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/citerators.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/citerators.cc @@ -19,25 +19,12 @@ // with this library; see the file COPYING3. If not see // . - #include -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - typedef std::unordered_multimap 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 int main() { - test01(); + typedef std::unordered_multimap test_type; + __gnu_test::citerator test; return 0; } diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/cliterators.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/cliterators.cc index d764369..612787c 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/cliterators.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/cliterators.cc @@ -19,26 +19,14 @@ // with this library; see the file COPYING3. If not see // . - #include -#include - -// DR 691. -void test01() -{ - bool test __attribute__((unused)) = true; - - typedef std::unordered_multimap 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 int main() { - test01(); + typedef std::unordered_multimap test_type; + typedef typename test_type::value_type value_type; + value_type v(1, 1); + __gnu_test::forward_members_unordered test(v); return 0; } diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation/1.cc similarity index 100% rename from libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation.cc rename to libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation/1.cc 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 index 0000000..e26428d --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation/2.cc @@ -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 +// . + +// This file tests explicit instantiation of library containers + +#include +#include +#include + +typedef __gnu_test::NonDefaultConstructible inst_type; +template class std::unordered_multimap; 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 index 0000000..5085f61 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation/3.cc @@ -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 +// . + +#include + +using namespace std; +template class unordered_multimap, equal_to, allocator>; diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/typedefs.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/typedefs.cc index e272e19..eb1b915 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/typedefs.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/typedefs.cc @@ -1,9 +1,7 @@ -// { dg-do compile } // { dg-options "-std=gnu++0x" } +// { dg-do compile } -// 2008-08-27 Paolo Carlini - -// 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 @@ -20,27 +18,8 @@ // with this library; see the file COPYING3. If not see // . +#include #include -void test01() -{ - // Check for required typedefs - typedef std::unordered_multimap 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 > t; diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/citerators.cc b/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/citerators.cc index 0db1195..6731848 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/citerators.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/citerators.cc @@ -19,24 +19,12 @@ // with this library; see the file COPYING3. If not see // . - #include -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - std::unordered_multiset ums; - ums.insert(1); - VERIFY( ums.cbegin() == ums.begin() ); - VERIFY( ums.cend() == ums.end() ); - VERIFY( ums.cbegin() != ums.cend() ); -} +#include int main() { - test01(); + typedef std::unordered_multiset test_type; + __gnu_test::citerator test; return 0; } diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/cliterators.cc b/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/cliterators.cc index ccaf1b6..c9db47c 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/cliterators.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/cliterators.cc @@ -19,26 +19,14 @@ // with this library; see the file COPYING3. If not see // . - #include -#include - -// DR 691. -void test01() -{ - bool test __attribute__((unused)) = true; - - typedef std::unordered_multiset 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 int main() { - test01(); + typedef std::unordered_multiset test_type; + typedef typename test_type::value_type value_type; + value_type v(1); + __gnu_test::forward_members_unordered test(v); return 0; } diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/explicit_instantiation/1.cc similarity index 100% rename from libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/explicit_instantiation.cc rename to libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/explicit_instantiation/1.cc 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 index 0000000..d2a120a --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/explicit_instantiation/2.cc @@ -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 +// . + +// This file tests explicit instantiation of library containers + +#include +#include +#include + +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 index 0000000..faf119c --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/explicit_instantiation/3.cc @@ -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 +// . + +#include + +using namespace std; +template class unordered_multiset, equal_to, allocator>; diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/typedefs.cc b/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/typedefs.cc index edd47a3..7e65e3a 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/typedefs.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/typedefs.cc @@ -1,9 +1,7 @@ -// { dg-do compile } // { dg-options "-std=gnu++0x" } +// { dg-do compile } -// 2008-08-27 Paolo Carlini - -// 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 @@ -20,26 +18,8 @@ // with this library; see the file COPYING3. If not see // . +#include #include -void test01() -{ - // Check for required typedefs - typedef std::unordered_multiset 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 > t; diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/citerators.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/citerators.cc index 765d99c..ce7f79f 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/citerators.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/citerators.cc @@ -19,24 +19,12 @@ // with this library; see the file COPYING3. If not see // . - #include -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - std::unordered_set us; - us.insert(1); - VERIFY( us.cbegin() == us.begin() ); - VERIFY( us.cend() == us.end() ); - VERIFY( us.cbegin() != us.cend() ); -} +#include int main() { - test01(); + typedef std::unordered_set test_type; + __gnu_test::citerator test; return 0; } diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/cliterators.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/cliterators.cc index ef356b6..8abef8c 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/cliterators.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/cliterators.cc @@ -19,26 +19,14 @@ // with this library; see the file COPYING3. If not see // . - #include -#include - -// DR 691. -void test01() -{ - bool test __attribute__((unused)) = true; - - typedef std::unordered_set 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 int main() { - test01(); + typedef std::unordered_set test_type; + typedef typename test_type::value_type value_type; + value_type v(1); + __gnu_test::forward_members_unordered test(v); return 0; } diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/explicit_instantiation/1.cc similarity index 100% rename from libstdc++-v3/testsuite/23_containers/unordered_set/requirements/explicit_instantiation.cc rename to libstdc++-v3/testsuite/23_containers/unordered_set/requirements/explicit_instantiation/1.cc 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 index 0000000..13e9e37 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/explicit_instantiation/2.cc @@ -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 +// . + +// This file tests explicit instantiation of library containers + +#include +#include +#include + +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 index 0000000..7d84ffd --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/explicit_instantiation/3.cc @@ -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 +// . + +#include + +using namespace std; +template class unordered_set, equal_to, allocator>; diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/typedefs.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/typedefs.cc index 4ebcb53..86983e5 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/typedefs.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/typedefs.cc @@ -1,9 +1,7 @@ -// { dg-do compile } // { dg-options "-std=gnu++0x" } +// { dg-do compile } -// 2008-08-27 Paolo Carlini - -// 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 @@ -20,26 +18,8 @@ // with this library; see the file COPYING3. If not see // . +#include #include -void test01() -{ - // Check for required typedefs - typedef std::unordered_set 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 > t; diff --git a/libstdc++-v3/testsuite/23_containers/vector/bool/requirements/citerators.cc b/libstdc++-v3/testsuite/23_containers/vector/bool/requirements/citerators.cc index b5eaebb..9f4783b 100644 --- a/libstdc++-v3/testsuite/23_containers/vector/bool/requirements/citerators.cc +++ b/libstdc++-v3/testsuite/23_containers/vector/bool/requirements/citerators.cc @@ -19,26 +19,12 @@ // with this library; see the file COPYING3. If not see // . - #include -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - std::vector 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 int main() { - test01(); + typedef std::vector test_type; + __gnu_test::citerator test; return 0; } diff --git a/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/bool/constructor.cc b/libstdc++-v3/testsuite/23_containers/vector/bool/requirements/dr438/constructor.cc similarity index 100% rename from libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/bool/constructor.cc rename to libstdc++-v3/testsuite/23_containers/vector/bool/requirements/dr438/constructor.cc diff --git a/libstdc++-v3/testsuite/23_containers/vector/requirements/citerators.cc b/libstdc++-v3/testsuite/23_containers/vector/requirements/citerators.cc index c9a07a1..eee16b0 100644 --- a/libstdc++-v3/testsuite/23_containers/vector/requirements/citerators.cc +++ b/libstdc++-v3/testsuite/23_containers/vector/requirements/citerators.cc @@ -19,26 +19,12 @@ // with this library; see the file COPYING3. If not see // . - #include -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - std::vector 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 int main() { - test01(); + typedef std::vector test_type; + __gnu_test::citerator 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 index 0000000..24897ff --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/vector/requirements/typedefs.cc @@ -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 +// . + +#include +#include + +// Check container for required typedefs. +__gnu_test::types > t; diff --git a/libstdc++-v3/testsuite/ext/vstring/requirements/citerators.cc b/libstdc++-v3/testsuite/ext/vstring/requirements/citerators.cc index 125cefd..582cada 100644 --- a/libstdc++-v3/testsuite/ext/vstring/requirements/citerators.cc +++ b/libstdc++-v3/testsuite/ext/vstring/requirements/citerators.cc @@ -20,26 +20,12 @@ // with this library; see the file COPYING3. If not see // . - #include -#include - -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 int main() { - test01(); + typedef __gnu_cxx::__vstring test_type; + __gnu_test::citerator 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 index 0000000..06db6af --- /dev/null +++ b/libstdc++-v3/testsuite/ext/vstring/requirements/typedefs.cc @@ -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 +// . + +#include +#include + +// 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 index 0000000..7c4b1a2 --- /dev/null +++ b/libstdc++-v3/testsuite/util/testsuite_container_traits.h @@ -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 +// . + +#ifndef _GLIBCXX_TESTSUITE_CONTAINER_TRAITS_H +#define _GLIBCXX_TESTSUITE_CONTAINER_TRAITS_H + +#include +#include + +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 + struct traits; + + // Specialize for each container. + template + struct traits > : public traits_base + { + typedef std::true_type is_container; + typedef std::true_type is_reversible; + }; + + template + struct traits > : 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 + struct traits > : public traits_base + { + typedef std::true_type is_container; + typedef std::true_type is_allocator_aware; + typedef std::true_type is_pointer_aware; + }; + + template + struct traits > : 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 + struct traits > : 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 + struct traits > : 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 + struct traits > : 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 + struct traits > : public traits_base + { + typedef std::true_type is_adaptor; + }; + + template + struct traits > : public traits_base + { + typedef std::true_type is_adaptor; + }; + + template + struct traits > : 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 + struct traits > : public traits_base + { + typedef std::true_type is_adaptor; + }; + + template + struct traits > : 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 + struct traits > : 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 + struct traits > : 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 + struct traits > : 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 + struct traits > : 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 + struct traits > : 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 + 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 index 0000000..62bf38f --- /dev/null +++ b/libstdc++-v3/testsuite/util/testsuite_containers.h @@ -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 +// . + +#ifndef _GLIBCXX_TESTSUITE_CONTAINERS_H +#define _GLIBCXX_TESTSUITE_CONTAINERS_H + +#include +#include + +// Container requirement testing. +namespace __gnu_test +{ + // Compile-time typedef testing. + template::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::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::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::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::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::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::is_mapped::value> + struct mapped_types + { + typedef _Tp test_type; + typedef typename test_type::mapped_type mapped_type; + }; + + template::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 + struct basic_types<_Tp, false> { }; + + template + struct reversible_types<_Tp, false> { }; + + template + struct allocator_aware_types<_Tp, false> { }; + + template + struct pointer_aware_types<_Tp, false> { }; + + template + struct associative_types<_Tp, false> { }; + + template + struct unordered_types<_Tp, false> { }; + + template + struct mapped_types<_Tp, false> { }; + + template + struct adaptor_types<_Tp, false> { }; + + // Primary template. + template + 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::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 + struct populate<_Tp, false> + { + populate(_Tp& container) { } + }; + + template::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 + struct reverse_members<_Tp, false> + { + reverse_members(_Tp& container) { } + }; + + // DR 691. + template::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 + struct forward_members_unordered<_Tp, false> + { + forward_members_unordered(_Tp& container) { } + }; + + template + struct citerator + { + typedef _Tp test_type; + typedef traits 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 p(_S_container); + forward_members m1; + reverse_members m2(_S_container); + } + }; + + template + _Tp citerator<_Tp>::_S_container; + + +} // namespace __gnu_test + +#endif -- 2.7.4