From bd1a56a0c3b639f1b343bf530bbdff004354848e Mon Sep 17 00:00:00 2001 From: Benjamin Kosnik Date: Fri, 7 Sep 2007 03:01:53 +0000 Subject: [PATCH] libstdc++.exp: Check CXXFLAGS. 2007-09-06 Benjamin Kosnik * testsuite/lib/libstdc++.exp: Check CXXFLAGS. * scripts/testsuite_flags.in: CXXFLAGS_default, matching dejagnu. * include/std/ostream: Spacing tweak. * include/ext/hashtable.h: Use . * include/ext/slist: Same. * include/ext/rope: Same. * include/bits/stl_function.h: Format. * include/tr1_impl/array: Remove section number in doxygen markup. * src/list.cc: Comment tweak. * docs/doxygen/user.cfg.in: Update for include/tr1_impl. * testsuite/25_algorithms/search_n/iterator.cc: Add using declaration. * testsuite/25_algorithms/nth_element/1.cc: Same. * testsuite/21_strings/char_traits/requirements/short/1.cc: Use char_type typedef to the underlying character type. * testsuite/21_strings/char_traits/requirements/wchar_t/typedefs.cc: Remove -ansi -pedantic-errors. * testsuite/21_strings/char_traits/requirements/char/typedefs.cc: Same. * testsuite/tr1/6_containers/headers/functional/synopsis.cc: Remove specializations. From-SVN: r128225 --- libstdc++-v3/ChangeLog | 25 +++ libstdc++-v3/config.h.in | 3 + libstdc++-v3/docs/doxygen/user.cfg.in | 29 +++- libstdc++-v3/include/bits/stl_function.h | 145 ++++++++++-------- libstdc++-v3/include/ext/hashtable.h | 4 +- libstdc++-v3/include/ext/rope | 5 +- libstdc++-v3/include/ext/slist | 4 +- libstdc++-v3/include/std/ostream | 2 +- libstdc++-v3/include/tr1_impl/array | 2 +- libstdc++-v3/scripts/testsuite_flags.in | 7 +- libstdc++-v3/src/list.cc | 4 +- .../char_traits/requirements/char/typedefs.cc | 1 - .../char_traits/requirements/short/1.cc | 109 +++++++------ .../requirements/wchar_t/typedefs.cc | 1 - .../testsuite/25_algorithms/nth_element/1.cc | 1 + .../25_algorithms/search_n/iterator.cc | 13 +- libstdc++-v3/testsuite/lib/libstdc++.exp | 17 +- .../headers/functional/synopsis.cc | 19 --- 18 files changed, 217 insertions(+), 174 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 0d995a51aa3..950ff94b466 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,28 @@ +2007-09-06 Benjamin Kosnik + + * testsuite/lib/libstdc++.exp: Check CXXFLAGS. + * scripts/testsuite_flags.in: CXXFLAGS_default, matching dejagnu. + + * include/std/ostream: Spacing tweak. + * include/ext/hashtable.h: Use . + * include/ext/slist: Same. + * include/ext/rope: Same. + * include/bits/stl_function.h: Format. + * include/tr1_impl/array: Remove section number in doxygen markup. + * src/list.cc: Comment tweak. + + * docs/doxygen/user.cfg.in: Update for include/tr1_impl. + + * testsuite/25_algorithms/search_n/iterator.cc: Add using declaration. + * testsuite/25_algorithms/nth_element/1.cc: Same. + * testsuite/21_strings/char_traits/requirements/short/1.cc: Use + char_type typedef to the underlying character type. + * testsuite/21_strings/char_traits/requirements/wchar_t/typedefs.cc: + Remove -ansi -pedantic-errors. + * testsuite/21_strings/char_traits/requirements/char/typedefs.cc: Same. + * testsuite/tr1/6_containers/headers/functional/synopsis.cc: + Remove specializations. + 2007-09-06 Paolo Carlini * include/bits/stl_vector.h (_Vector_base<>::_M_allocate): diff --git a/libstdc++-v3/config.h.in b/libstdc++-v3/config.h.in index be830a0c1ce..647657c4f27 100644 --- a/libstdc++-v3/config.h.in +++ b/libstdc++-v3/config.h.in @@ -60,6 +60,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H +/* Define if EBADMSG exists. */ +#undef HAVE_EBADMSG + /* Define to 1 if you have the header file. */ #undef HAVE_ENDIAN_H diff --git a/libstdc++-v3/docs/doxygen/user.cfg.in b/libstdc++-v3/docs/doxygen/user.cfg.in index 1484c78f68f..9854f76a7a7 100644 --- a/libstdc++-v3/docs/doxygen/user.cfg.in +++ b/libstdc++-v3/docs/doxygen/user.cfg.in @@ -300,7 +300,7 @@ INTERNAL_DOCS = NO # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. -CASE_SENSE_NAMES = NO# +CASE_SENSE_NAMES = NO # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen # will show members with their full class and namespace scopes in the @@ -480,6 +480,7 @@ INPUT = @srcdir@/docs/doxygen/doxygroups.cc \ include/debug \ include/ext \ include/tr1 \ + include/tr1_impl \ include/algorithm \ include/array \ include/bitset \ @@ -580,7 +581,7 @@ INPUT = @srcdir@/docs/doxygen/doxygroups.cc \ include/tr1/cwchar \ include/tr1/cwctype \ include/tr1/functional \ - include/tr1/hashtable \ + include/tr1/hashtable.h \ include/tr1/memory \ include/tr1/random \ include/tr1/regex \ @@ -588,7 +589,26 @@ INPUT = @srcdir@/docs/doxygen/doxygroups.cc \ include/tr1/type_traits \ include/tr1/unordered_map \ include/tr1/unordered_set \ - include/tr1/utility + include/tr1_impl/utility \ + include/tr1_impl/array \ + include/tr1_impl/cctype \ + include/tr1_impl/cfenv \ + include/tr1_impl/cinttypes \ + include/tr1_impl/cmath \ + include/tr1_impl/complex \ + include/tr1_impl/cstdint \ + include/tr1_impl/cstdio \ + include/tr1_impl/cstdlib \ + include/tr1_impl/cwchar \ + include/tr1_impl/cwctype \ + include/tr1_impl/functional \ + include/tr1_impl/random \ + include/tr1_impl/regex \ + include/tr1_impl/tuple \ + include/tr1_impl/type_traits \ + include/tr1_impl/unordered_map \ + include/tr1_impl/unordered_set \ + include/tr1_impl/utility # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like @@ -1284,8 +1304,7 @@ UML_LOOK = NO # If set to YES, the inheritance and collaboration graphs will show the # relations between templates and their instances. -#TEMPLATE_RELATIONS = YES -TEMPLATE_RELATIONS = NO +TEMPLATE_RELATIONS = YES # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT # tags are set to YES then doxygen will generate a graph for each documented diff --git a/libstdc++-v3/include/bits/stl_function.h b/libstdc++-v3/include/bits/stl_function.h index 7dc5031d46f..ece42a3e2eb 100644 --- a/libstdc++-v3/include/bits/stl_function.h +++ b/libstdc++-v3/include/bits/stl_function.h @@ -99,7 +99,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) /** * This is one of the @link s20_3_1_base functor base classes@endlink. */ - template + template struct unary_function { typedef _Arg argument_type; ///< @c argument_type is the type of the @@ -111,7 +111,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) /** * This is one of the @link s20_3_1_base functor base classes@endlink. */ - template + template struct binary_function { typedef _Arg1 first_argument_type; ///< the type of the first argument @@ -133,7 +133,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) * @{ */ /// One of the @link s20_3_2_arithmetic math functors@endlink. - template + template struct plus : public binary_function<_Tp, _Tp, _Tp> { _Tp @@ -142,7 +142,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) }; /// One of the @link s20_3_2_arithmetic math functors@endlink. - template + template struct minus : public binary_function<_Tp, _Tp, _Tp> { _Tp @@ -151,7 +151,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) }; /// One of the @link s20_3_2_arithmetic math functors@endlink. - template + template struct multiplies : public binary_function<_Tp, _Tp, _Tp> { _Tp @@ -160,7 +160,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) }; /// One of the @link s20_3_2_arithmetic math functors@endlink. - template + template struct divides : public binary_function<_Tp, _Tp, _Tp> { _Tp @@ -169,7 +169,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) }; /// One of the @link s20_3_2_arithmetic math functors@endlink. - template + template struct modulus : public binary_function<_Tp, _Tp, _Tp> { _Tp @@ -178,7 +178,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) }; /// One of the @link s20_3_2_arithmetic math functors@endlink. - template + template struct negate : public unary_function<_Tp, _Tp> { _Tp @@ -195,7 +195,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) * @{ */ /// One of the @link s20_3_3_comparisons comparison functors@endlink. - template + template struct equal_to : public binary_function<_Tp, _Tp, bool> { bool @@ -204,7 +204,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) }; /// One of the @link s20_3_3_comparisons comparison functors@endlink. - template + template struct not_equal_to : public binary_function<_Tp, _Tp, bool> { bool @@ -213,7 +213,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) }; /// One of the @link s20_3_3_comparisons comparison functors@endlink. - template + template struct greater : public binary_function<_Tp, _Tp, bool> { bool @@ -222,7 +222,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) }; /// One of the @link s20_3_3_comparisons comparison functors@endlink. - template + template struct less : public binary_function<_Tp, _Tp, bool> { bool @@ -231,7 +231,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) }; /// One of the @link s20_3_3_comparisons comparison functors@endlink. - template + template struct greater_equal : public binary_function<_Tp, _Tp, bool> { bool @@ -240,7 +240,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) }; /// One of the @link s20_3_3_comparisons comparison functors@endlink. - template + template struct less_equal : public binary_function<_Tp, _Tp, bool> { bool @@ -257,7 +257,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) * @{ */ /// One of the @link s20_3_4_logical Boolean operations functors@endlink. - template + template struct logical_and : public binary_function<_Tp, _Tp, bool> { bool @@ -266,7 +266,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) }; /// One of the @link s20_3_4_logical Boolean operations functors@endlink. - template + template struct logical_or : public binary_function<_Tp, _Tp, bool> { bool @@ -275,7 +275,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) }; /// One of the @link s20_3_4_logical Boolean operations functors@endlink. - template + template struct logical_not : public unary_function<_Tp, bool> { bool @@ -286,7 +286,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) // _GLIBCXX_RESOLVE_LIB_DEFECTS // DR 660. Missing Bitwise Operations. - template + template struct bit_and : public binary_function<_Tp, _Tp, _Tp> { _Tp @@ -294,7 +294,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) { return __x & __y; } }; - template + template struct bit_or : public binary_function<_Tp, _Tp, _Tp> { _Tp @@ -302,7 +302,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) { return __x | __y; } }; - template + template struct bit_xor : public binary_function<_Tp, _Tp, _Tp> { _Tp @@ -338,15 +338,16 @@ _GLIBCXX_BEGIN_NAMESPACE(std) * @{ */ /// One of the @link s20_3_5_negators negation functors@endlink. - template + template class unary_negate : public unary_function { protected: _Predicate _M_pred; + public: explicit - unary_negate(const _Predicate& __x) : _M_pred(__x) {} + unary_negate(const _Predicate& __x) : _M_pred(__x) { } bool operator()(const typename _Predicate::argument_type& __x) const @@ -354,13 +355,13 @@ _GLIBCXX_BEGIN_NAMESPACE(std) }; /// One of the @link s20_3_5_negators negation functors@endlink. - template + template inline unary_negate<_Predicate> not1(const _Predicate& __pred) { return unary_negate<_Predicate>(__pred); } /// One of the @link s20_3_5_negators negation functors@endlink. - template + template class binary_negate : public binary_function @@ -379,7 +380,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) }; /// One of the @link s20_3_5_negators negation functors@endlink. - template + template inline binary_negate<_Predicate> not2(const _Predicate& __pred) { return binary_negate<_Predicate>(__pred); } @@ -417,7 +418,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) * @{ */ /// One of the @link s20_3_6_binder binder functors@endlink. - template + template class binder1st : public unary_function @@ -425,10 +426,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std) protected: _Operation op; typename _Operation::first_argument_type value; + public: binder1st(const _Operation& __x, const typename _Operation::first_argument_type& __y) - : op(__x), value(__y) {} + : op(__x), value(__y) { } typename _Operation::result_type operator()(const typename _Operation::second_argument_type& __x) const @@ -442,7 +444,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) }; /// One of the @link s20_3_6_binder binder functors@endlink. - template + template inline binder1st<_Operation> bind1st(const _Operation& __fn, const _Tp& __x) { @@ -451,7 +453,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) } /// One of the @link s20_3_6_binder binder functors@endlink. - template + template class binder2nd : public unary_function @@ -459,10 +461,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std) protected: _Operation op; typename _Operation::second_argument_type value; + public: binder2nd(const _Operation& __x, const typename _Operation::second_argument_type& __y) - : op(__x), value(__y) {} + : op(__x), value(__y) { } typename _Operation::result_type operator()(const typename _Operation::first_argument_type& __x) const @@ -476,7 +479,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) }; /// One of the @link s20_3_6_binder binder functors@endlink. - template + template inline binder2nd<_Operation> bind2nd(const _Operation& __fn, const _Tp& __x) { @@ -506,17 +509,18 @@ _GLIBCXX_BEGIN_NAMESPACE(std) * @{ */ /// One of the @link s20_3_7_adaptors adaptors for function pointers@endlink. - template + template class pointer_to_unary_function : public unary_function<_Arg, _Result> { protected: _Result (*_M_ptr)(_Arg); + public: - pointer_to_unary_function() {} + pointer_to_unary_function() { } explicit pointer_to_unary_function(_Result (*__x)(_Arg)) - : _M_ptr(__x) {} + : _M_ptr(__x) { } _Result operator()(_Arg __x) const @@ -524,24 +528,25 @@ _GLIBCXX_BEGIN_NAMESPACE(std) }; /// One of the @link s20_3_7_adaptors adaptors for function pointers@endlink. - template + template inline pointer_to_unary_function<_Arg, _Result> ptr_fun(_Result (*__x)(_Arg)) { return pointer_to_unary_function<_Arg, _Result>(__x); } /// One of the @link s20_3_7_adaptors adaptors for function pointers@endlink. - template + template class pointer_to_binary_function : public binary_function<_Arg1, _Arg2, _Result> { protected: _Result (*_M_ptr)(_Arg1, _Arg2); + public: - pointer_to_binary_function() {} + pointer_to_binary_function() { } explicit pointer_to_binary_function(_Result (*__x)(_Arg1, _Arg2)) - : _M_ptr(__x) {} + : _M_ptr(__x) { } _Result operator()(_Arg1 __x, _Arg2 __y) const @@ -549,13 +554,13 @@ _GLIBCXX_BEGIN_NAMESPACE(std) }; /// One of the @link s20_3_7_adaptors adaptors for function pointers@endlink. - template + template inline pointer_to_binary_function<_Arg1, _Arg2, _Result> ptr_fun(_Result (*__x)(_Arg1, _Arg2)) { return pointer_to_binary_function<_Arg1, _Arg2, _Result>(__x); } /** @} */ - template + template struct _Identity : public unary_function<_Tp,_Tp> { _Tp& @@ -567,7 +572,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) { return __x; } }; - template + template struct _Select1st : public unary_function<_Pair, typename _Pair::first_type> { @@ -580,7 +585,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) { return __x.first; } }; - template + template struct _Select2nd : public unary_function<_Pair, typename _Pair::second_type> { @@ -609,178 +614,186 @@ _GLIBCXX_BEGIN_NAMESPACE(std) */ /// One of the @link s20_3_8_memadaptors adaptors for member /// pointers@endlink. - template + template class mem_fun_t : public unary_function<_Tp*, _Ret> { public: explicit mem_fun_t(_Ret (_Tp::*__pf)()) - : _M_f(__pf) {} + : _M_f(__pf) { } _Ret operator()(_Tp* __p) const { return (__p->*_M_f)(); } + private: _Ret (_Tp::*_M_f)(); }; /// One of the @link s20_3_8_memadaptors adaptors for member /// pointers@endlink. - template + template class const_mem_fun_t : public unary_function { public: explicit const_mem_fun_t(_Ret (_Tp::*__pf)() const) - : _M_f(__pf) {} + : _M_f(__pf) { } _Ret operator()(const _Tp* __p) const { return (__p->*_M_f)(); } + private: _Ret (_Tp::*_M_f)() const; }; /// One of the @link s20_3_8_memadaptors adaptors for member /// pointers@endlink. - template + template class mem_fun_ref_t : public unary_function<_Tp, _Ret> { public: explicit mem_fun_ref_t(_Ret (_Tp::*__pf)()) - : _M_f(__pf) {} + : _M_f(__pf) { } _Ret operator()(_Tp& __r) const { return (__r.*_M_f)(); } + private: _Ret (_Tp::*_M_f)(); }; /// One of the @link s20_3_8_memadaptors adaptors for member /// pointers@endlink. - template + template class const_mem_fun_ref_t : public unary_function<_Tp, _Ret> { public: explicit const_mem_fun_ref_t(_Ret (_Tp::*__pf)() const) - : _M_f(__pf) {} + : _M_f(__pf) { } _Ret operator()(const _Tp& __r) const { return (__r.*_M_f)(); } + private: _Ret (_Tp::*_M_f)() const; }; /// One of the @link s20_3_8_memadaptors adaptors for member /// pointers@endlink. - template + template class mem_fun1_t : public binary_function<_Tp*, _Arg, _Ret> { public: explicit mem_fun1_t(_Ret (_Tp::*__pf)(_Arg)) - : _M_f(__pf) {} + : _M_f(__pf) { } _Ret operator()(_Tp* __p, _Arg __x) const { return (__p->*_M_f)(__x); } + private: _Ret (_Tp::*_M_f)(_Arg); }; /// One of the @link s20_3_8_memadaptors adaptors for member /// pointers@endlink. - template + template class const_mem_fun1_t : public binary_function { public: explicit const_mem_fun1_t(_Ret (_Tp::*__pf)(_Arg) const) - : _M_f(__pf) {} + : _M_f(__pf) { } _Ret operator()(const _Tp* __p, _Arg __x) const { return (__p->*_M_f)(__x); } + private: _Ret (_Tp::*_M_f)(_Arg) const; }; /// One of the @link s20_3_8_memadaptors adaptors for member /// pointers@endlink. - template + template class mem_fun1_ref_t : public binary_function<_Tp, _Arg, _Ret> { public: explicit mem_fun1_ref_t(_Ret (_Tp::*__pf)(_Arg)) - : _M_f(__pf) {} + : _M_f(__pf) { } _Ret operator()(_Tp& __r, _Arg __x) const { return (__r.*_M_f)(__x); } + private: _Ret (_Tp::*_M_f)(_Arg); }; /// One of the @link s20_3_8_memadaptors adaptors for member /// pointers@endlink. - template + template class const_mem_fun1_ref_t : public binary_function<_Tp, _Arg, _Ret> { public: explicit const_mem_fun1_ref_t(_Ret (_Tp::*__pf)(_Arg) const) - : _M_f(__pf) {} + : _M_f(__pf) { } _Ret operator()(const _Tp& __r, _Arg __x) const { return (__r.*_M_f)(__x); } + private: _Ret (_Tp::*_M_f)(_Arg) const; }; // Mem_fun adaptor helper functions. There are only two: // mem_fun and mem_fun_ref. - template + template inline mem_fun_t<_Ret, _Tp> mem_fun(_Ret (_Tp::*__f)()) { return mem_fun_t<_Ret, _Tp>(__f); } - template + template inline const_mem_fun_t<_Ret, _Tp> mem_fun(_Ret (_Tp::*__f)() const) { return const_mem_fun_t<_Ret, _Tp>(__f); } - template + template inline mem_fun_ref_t<_Ret, _Tp> mem_fun_ref(_Ret (_Tp::*__f)()) { return mem_fun_ref_t<_Ret, _Tp>(__f); } - template + template inline const_mem_fun_ref_t<_Ret, _Tp> mem_fun_ref(_Ret (_Tp::*__f)() const) { return const_mem_fun_ref_t<_Ret, _Tp>(__f); } - template + template inline mem_fun1_t<_Ret, _Tp, _Arg> mem_fun(_Ret (_Tp::*__f)(_Arg)) { return mem_fun1_t<_Ret, _Tp, _Arg>(__f); } - template + template inline const_mem_fun1_t<_Ret, _Tp, _Arg> mem_fun(_Ret (_Tp::*__f)(_Arg) const) { return const_mem_fun1_t<_Ret, _Tp, _Arg>(__f); } - template + template inline mem_fun1_ref_t<_Ret, _Tp, _Arg> mem_fun_ref(_Ret (_Tp::*__f)(_Arg)) { return mem_fun1_ref_t<_Ret, _Tp, _Arg>(__f); } - template + template inline const_mem_fun1_ref_t<_Ret, _Tp, _Arg> mem_fun_ref(_Ret (_Tp::*__f)(_Arg) const) { return const_mem_fun1_ref_t<_Ret, _Tp, _Arg>(__f); } diff --git a/libstdc++-v3/include/ext/hashtable.h b/libstdc++-v3/include/ext/hashtable.h index 233806fb745..e73b7df72c4 100644 --- a/libstdc++-v3/include/ext/hashtable.h +++ b/libstdc++-v3/include/ext/hashtable.h @@ -1,6 +1,6 @@ // Hashtable implementation used by containers -*- C++ -*- -// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 +// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -67,7 +67,7 @@ #include #include -#include +#include #include #include diff --git a/libstdc++-v3/include/ext/rope b/libstdc++-v3/include/ext/rope index e0f0aa39036..b5489176c52 100644 --- a/libstdc++-v3/include/ext/rope +++ b/libstdc++-v3/include/ext/rope @@ -49,15 +49,14 @@ #ifndef _ROPE #define _ROPE 1 -#include +#include +#include #include #include -#include #include #include #include #include -#include #include # ifdef __GC diff --git a/libstdc++-v3/include/ext/slist b/libstdc++-v3/include/ext/slist index 328a52e012f..7ae9ffbe101 100644 --- a/libstdc++-v3/include/ext/slist +++ b/libstdc++-v3/include/ext/slist @@ -1,6 +1,6 @@ // Singly-linked list implementation -*- C++ -*- -// Copyright (C) 2001, 2002, 2004, 2005 Free Software Foundation, Inc. +// Copyright (C) 2001, 2002, 2004, 2005, 2007 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 @@ -49,7 +49,7 @@ #ifndef _SLIST #define _SLIST 1 -#include +#include #include #include #include diff --git a/libstdc++-v3/include/std/ostream b/libstdc++-v3/include/std/ostream index 67dcc555cff..4fb6d19b7fc 100644 --- a/libstdc++-v3/include/std/ostream +++ b/libstdc++-v3/include/std/ostream @@ -539,7 +539,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) template inline basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __out, const error_code& __e) -{ return (__out << __e.category().name().c_str() << ':' << __e.value()); } + { return (__out << __e.category().name().c_str() << ':' << __e.value()); } #endif // [27.6.2.7] standard basic_ostream manipulators diff --git a/libstdc++-v3/include/tr1_impl/array b/libstdc++-v3/include/tr1_impl/array index 0fda088aa53..994d4ddcf6d 100644 --- a/libstdc++-v3/include/tr1_impl/array +++ b/libstdc++-v3/include/tr1_impl/array @@ -36,7 +36,7 @@ namespace std { _GLIBCXX_BEGIN_NAMESPACE_TR1 - /// @brief struct array [6.2.2]. + /// @brief struct array. /// NB: Requires complete type _Tp. template struct array diff --git a/libstdc++-v3/scripts/testsuite_flags.in b/libstdc++-v3/scripts/testsuite_flags.in index 13bd68b699c..16623e0f615 100755 --- a/libstdc++-v3/scripts/testsuite_flags.in +++ b/libstdc++-v3/scripts/testsuite_flags.in @@ -54,10 +54,9 @@ case ${query} in echo ${CC} ;; --cxxflags) - CXXFLAGS_save="-g -O2 -D_GLIBCXX_ASSERT" - CXXFLAGS_config='@SECTION_FLAGS@ -fmessage-length=0 - @CXXFLAGS@ @EXTRA_CXX_FLAGS@ ' - echo ${CXXFLAGS_save} ${CXXFLAGS_config} + CXXFLAGS_default="-g -O2 -D_GLIBCXX_ASSERT -fmessage-length=0" + CXXFLAGS_config="@SECTION_FLAGS@ @CXXFLAGS@ @EXTRA_CXX_FLAGS@" + echo ${CXXFLAGS_default} ${CXXFLAGS_config} ;; --cxxpchflags) PCHFLAGS="@glibcxx_PCHFLAGS@" diff --git a/libstdc++-v3/src/list.cc b/libstdc++-v3/src/list.cc index fe68ba1d7a4..e1f82e69c5d 100644 --- a/libstdc++-v3/src/list.cc +++ b/libstdc++-v3/src/list.cc @@ -115,7 +115,9 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD) do { std::swap(__tmp->_M_next, __tmp->_M_prev); - __tmp = __tmp->_M_prev; // Old next node is now prev. + + // Old next node is now prev. + __tmp = __tmp->_M_prev; } while (__tmp != this); } diff --git a/libstdc++-v3/testsuite/21_strings/char_traits/requirements/char/typedefs.cc b/libstdc++-v3/testsuite/21_strings/char_traits/requirements/char/typedefs.cc index 333142018e4..13b70390766 100644 --- a/libstdc++-v3/testsuite/21_strings/char_traits/requirements/char/typedefs.cc +++ b/libstdc++-v3/testsuite/21_strings/char_traits/requirements/char/typedefs.cc @@ -1,5 +1,4 @@ // { dg-do compile } -// { dg-options "-ansi -pedantic-errors" } // 2001-02-11 gdr // Origin: Craig Rodrigues diff --git a/libstdc++-v3/testsuite/21_strings/char_traits/requirements/short/1.cc b/libstdc++-v3/testsuite/21_strings/char_traits/requirements/short/1.cc index 3a0394daf1f..2e1b631f75c 100644 --- a/libstdc++-v3/testsuite/21_strings/char_traits/requirements/short/1.cc +++ b/libstdc++-v3/testsuite/21_strings/char_traits/requirements/short/1.cc @@ -31,6 +31,7 @@ void test02(void) { + typedef short char_type; bool test __attribute__((unused)) = true; // 21.1.1 character traits requirements @@ -45,67 +46,67 @@ void test02(void) // pos == X::pos_type // state == X::state_type - // void X::assign(short c, short d) + // void X::assign(char_type c, char_type d) // assigns c = d; - short c1 = 'z'; - short c2 = 'u'; + char_type c1 = 'z'; + char_type c2 = 'u'; VERIFY( c1 != c2 ); - std::char_traits::assign(c1,c2); + std::char_traits::assign(c1,c2); VERIFY( c1 == 'u' ); - // bool X::eq(short c, short d) + // bool X::eq(char_type c, char_type d) c1 = 'z'; c2 = 'u'; - VERIFY ( !std::char_traits::eq(c1, c2) ); - VERIFY ( std::char_traits::eq(c1, c1) ); - VERIFY ( std::char_traits::eq(c2, c2) ); + VERIFY ( !std::char_traits::eq(c1, c2) ); + VERIFY ( std::char_traits::eq(c1, c1) ); + VERIFY ( std::char_traits::eq(c2, c2) ); - // bool X::lt(short c, short d) + // bool X::lt(char_type c, char_type d) c1 = 'z'; c2 = 'u'; - VERIFY ( std::char_traits::lt(c2, c1) ); - VERIFY ( !std::char_traits::lt(c1, c2) ); - VERIFY ( !std::char_traits::lt(c1, c1) ); - VERIFY ( !std::char_traits::lt(c2, c2) ); + VERIFY ( std::char_traits::lt(c2, c1) ); + VERIFY ( !std::char_traits::lt(c1, c2) ); + VERIFY ( !std::char_traits::lt(c1, c1) ); + VERIFY ( !std::char_traits::lt(c2, c2) ); - // short* X::move(short* s, const short* p, size_t n) + // char_type* X::move(char_type* s, const char_type* p, size_t n) // for each i in [0,n) performs X::assign(s[i], p[i]). Copies // correctly even where p is in [s, s + n), and yields s. - short array1[] = {'z', 'u', 'm', 'a', ' ', 'b', 'e', 'a', 'c', 'h', 0}; - const std::basic_string str_01(array1 + 0, array1 + 10); + char_type array1[] = {'z', 'u', 'm', 'a', ' ', 'b', 'e', 'a', 'c', 'h', 0}; + const std::basic_string str_01(array1 + 0, array1 + 10); - const short str_lit1[] = {'m', 'o', 'n', 't', 'a', 'r', 'a', ' ', 'a', 'n', 'd', ' ', 'o', 'c', 'e', 'a', 'n', ' ', 'b', 'e', 'a', 'c', 'h', 0}; + const char_type str_lit1[] = {'m', 'o', 'n', 't', 'a', 'r', 'a', ' ', 'a', 'n', 'd', ' ', 'o', 'c', 'e', 'a', 'n', ' ', 'b', 'e', 'a', 'c', 'h', 0}; - int len = sizeof(str_lit1)/sizeof(short) + sizeof(array1)/sizeof(short) - 1; + int len = sizeof(str_lit1)/sizeof(char_type) + sizeof(array1)/sizeof(char_type) - 1; // two terminating chars - short array3[] = {'b', 'o', 'r', 'a', 'c', 'a', 'y', ',', ' ', 'p', 'h', 'i', 'l', 'i', 'p', 'p', 'i', 'n', 'e', 's', 0}; - short array2[len]; - std::char_traits::copy(array2, array3, len); + char_type array3[] = {'b', 'o', 'r', 'a', 'c', 'a', 'y', ',', ' ', 'p', 'h', 'i', 'l', 'i', 'p', 'p', 'i', 'n', 'e', 's', 0}; + char_type array2[len]; + std::char_traits::copy(array2, array3, len); VERIFY( str_lit1[0] == 'm' ); c1 = array2[0]; c2 = str_lit1[0]; - short c3 = array2[1]; - short c4 = str_lit1[1]; - std::char_traits::move(array2, str_lit1, 0); + char_type c3 = array2[1]; + char_type c4 = str_lit1[1]; + std::char_traits::move(array2, str_lit1, 0); VERIFY( array2[0] == c1 ); VERIFY( str_lit1[0] == c2 ); - std::char_traits::move(array2, str_lit1, 1); + std::char_traits::move(array2, str_lit1, 1); VERIFY( array2[0] == c2 ); VERIFY( str_lit1[0] == c2 ); VERIFY( array2[1] == c3 ); VERIFY( str_lit1[1] == c4 ); - std::char_traits::move(array2, str_lit1, 2); + std::char_traits::move(array2, str_lit1, 2); VERIFY( array2[0] == c2 ); VERIFY( str_lit1[0] == c2 ); VERIFY( array2[1] == c4 ); VERIFY( str_lit1[1] == c4 ); - short* pc1 = array1 + 1; + char_type* pc1 = array1 + 1; c1 = pc1[0]; c2 = array1[0]; VERIFY( c1 != c2 ); - short* pc2 = std::char_traits::move(array1, pc1, 0); + char_type* pc2 = std::char_traits::move(array1, pc1, 0); c3 = pc1[0]; c4 = array1[0]; VERIFY( c1 == c3 ); @@ -114,11 +115,11 @@ void test02(void) c1 = pc1[0]; c2 = array1[0]; - short* pc3 = pc1; - pc2 = std::char_traits::move(array1, pc1, 10); + char_type* pc3 = pc1; + pc2 = std::char_traits::move(array1, pc1, 10); c3 = pc1[0]; c4 = array1[0]; - VERIFY( c1 != c3 ); // underlying short array changed. + VERIFY( c1 != c3 ); // underlying char_type array changed. VERIFY( c4 != c3 ); VERIFY( pc2 == array1 ); VERIFY( pc3 == pc1 ); // but pointers o-tay @@ -126,49 +127,47 @@ void test02(void) c2 = array1[0]; VERIFY( c1 != c2 ); - // size_t X::length(const short* p) - len = std::char_traits::length(str_lit1); - VERIFY( len == sizeof(str_lit1) / sizeof(short) - 1 ); + // size_t X::length(const char_type* p) + len = std::char_traits::length(str_lit1); + VERIFY( len == sizeof(str_lit1) / sizeof(char_type) - 1 ); - // const short* X::find(const short* s, size_t n, short c) - const int N4 = sizeof(str_lit1) / sizeof(short); - const short* pc4 = std::char_traits::find(str_lit1, N4, 'a'); + // const char_type* X::find(const char_type* s, size_t n, char_type c) + const int N4 = sizeof(str_lit1) / sizeof(char_type); + const char_type* pc4 = std::char_traits::find(str_lit1, N4, 'a'); VERIFY( pc4 != 0 ); VERIFY( *pc4 == 'a' ); - pc4 = std::char_traits::find(str_lit1, N4, 0x0a73); + pc4 = std::char_traits::find(str_lit1, N4, 0x0a73); VERIFY( pc4 == 0 ); - // short* X::assign(short* s, size_t n, short c) - len = sizeof(array2) / sizeof(short); - std::memset(array2, 0xaf, len * sizeof(short)); + // char_type* X::assign(char_type* s, size_t n, char_type c) + len = sizeof(array2) / sizeof(char_type); + std::memset(array2, 0xaf, len * sizeof(char_type)); VERIFY( array2[0] != 0x15a8 ); - pc1 = std::char_traits::assign (array2, len, 0x15a8); + pc1 = std::char_traits::assign (array2, len, 0x15a8); VERIFY( pc1 == array2 ); for (int i = 0; i < len; ++i) VERIFY( array2[i] == 0x15a8 ); - // short* X::copy(short* s, const short* p, size_t n) - int n1 = sizeof(str_lit1) / sizeof(short); - pc1 = std::char_traits::copy(array2, str_lit1, n1); - len = std::char_traits::length(array2); + // char_type* X::copy(char_type* s, const char_type* p, size_t n) + int n1 = sizeof(str_lit1) / sizeof(char_type); + pc1 = std::char_traits::copy(array2, str_lit1, n1); + len = std::char_traits::length(array2); VERIFY( len == n1 - 1 ); for (int i = 0; i < len; ++i) VERIFY( str_lit1[i] == array2[i] ); - // int X::compare(const short* p, const short* q, size_t n) - const short* pconst1 = str_01.data(); - const short* pconst2 = str_lit1; + // int X::compare(const char_type* p, const char_type* q, size_t n) + const char_type* pconst1 = str_01.data(); + const char_type* pconst2 = str_lit1; - VERIFY( std::char_traits::compare(pconst1, pconst2, 10) > 0 ); - VERIFY( std::char_traits::compare(pconst2, pconst1, 10) < 0 ); - VERIFY( std::char_traits::compare(pconst1, pconst1, 10) == 0 ); - VERIFY( std::char_traits::compare(pconst2, pconst2, 10) == 0 ); + VERIFY( std::char_traits::compare(pconst1, pconst2, 10) > 0 ); + VERIFY( std::char_traits::compare(pconst2, pconst1, 10) < 0 ); + VERIFY( std::char_traits::compare(pconst1, pconst1, 10) == 0 ); + VERIFY( std::char_traits::compare(pconst2, pconst2, 10) == 0 ); } - - int main() { test02(); diff --git a/libstdc++-v3/testsuite/21_strings/char_traits/requirements/wchar_t/typedefs.cc b/libstdc++-v3/testsuite/21_strings/char_traits/requirements/wchar_t/typedefs.cc index 6026eac89af..6bd990aa11f 100644 --- a/libstdc++-v3/testsuite/21_strings/char_traits/requirements/wchar_t/typedefs.cc +++ b/libstdc++-v3/testsuite/21_strings/char_traits/requirements/wchar_t/typedefs.cc @@ -1,5 +1,4 @@ // { dg-do compile } -// { dg-options "-ansi -pedantic-errors" } // 2001-02-11 gdr // Origin: Craig Rodrigues diff --git a/libstdc++-v3/testsuite/25_algorithms/nth_element/1.cc b/libstdc++-v3/testsuite/25_algorithms/nth_element/1.cc index 80b4776d23b..2ce39dd4389 100644 --- a/libstdc++-v3/testsuite/25_algorithms/nth_element/1.cc +++ b/libstdc++-v3/testsuite/25_algorithms/nth_element/1.cc @@ -25,6 +25,7 @@ using __gnu_test::test_container; using __gnu_test::random_access_iterator_wrapper; using std::nth_element; +using std::partial_sort; typedef test_container Container; diff --git a/libstdc++-v3/testsuite/25_algorithms/search_n/iterator.cc b/libstdc++-v3/testsuite/25_algorithms/search_n/iterator.cc index 7aeaac34b0b..2a9b0f42a09 100644 --- a/libstdc++-v3/testsuite/25_algorithms/search_n/iterator.cc +++ b/libstdc++-v3/testsuite/25_algorithms/search_n/iterator.cc @@ -52,12 +52,15 @@ lexstep(int* start, int length) return !carry; } -using __gnu_test::test_container; -using __gnu_test::random_access_iterator_wrapper; -using __gnu_test::bidirectional_iterator_wrapper; -using __gnu_test::forward_iterator_wrapper; +int main() +{ + using __gnu_test::test_container; + using __gnu_test::random_access_iterator_wrapper; + using __gnu_test::bidirectional_iterator_wrapper; + using __gnu_test::forward_iterator_wrapper; + + using std::search_n; -int main() { test_container con(array1,array1 + 10); VERIFY(search_n(con.end(), con.end(), 0, 1) == con.end()); VERIFY(search_n(con.end(), con.end(), 1, 1) == con.end()); diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp index a0bca54d485..70b588d20df 100644 --- a/libstdc++-v3/testsuite/lib/libstdc++.exp +++ b/libstdc++-v3/testsuite/lib/libstdc++.exp @@ -171,13 +171,6 @@ proc libstdc++_init { testfile } { set compiler [transform "g++"] } - # Default settings. - set cxx [transform "g++"] - set cxxflags "-g -O2 -D_GLIBCXX_ASSERT -fmessage-length=0" - set cxxldflags "" - set cc [transform "gcc"] - # Locate testsuite_hooks.h and other testsuite headers. - set includes "-I${srcdir}/util" # Adapt the defaults for special circumstances. if [is_remote host] { # A remote host does not, in general, have access to the @@ -206,6 +199,12 @@ proc libstdc++_init { testfile } { return "untested" } } + # Default settings. + set cxx [transform "g++"] + set cxxflags "-g -O2 -D_GLIBCXX_ASSERT -fmessage-length=0 " + set cxxldflags "" + set cc [transform "gcc"] + # Locate testsuite_hooks.h and other testsuite headers. set includes "-Iutil" } elseif { [file exists $flags_file] } { # If we find a testsuite_flags file, we're testing in the build dir. @@ -215,6 +214,9 @@ proc libstdc++_init { testfile } { set cc [exec sh $flags_file --build-cc] set includes [exec sh $flags_file --build-includes] } + append cxxflags " " + append cxxflags [getenv CXXFLAGS] + v3track cxxflags 2 # Always use MO files built by this test harness. set cxxflags "$cxxflags -DLOCALEDIR=\".\"" @@ -830,7 +832,6 @@ proc check_v3_target_namedlocale { } { proc check_v3_target_debug_mode { } { global cxxflags global et_debug_mode - global tool if { ![info exists et_debug_mode_target_name] } { diff --git a/libstdc++-v3/testsuite/tr1/6_containers/headers/functional/synopsis.cc b/libstdc++-v3/testsuite/tr1/6_containers/headers/functional/synopsis.cc index c4e2e9c3160..fd0b595eb3f 100644 --- a/libstdc++-v3/testsuite/tr1/6_containers/headers/functional/synopsis.cc +++ b/libstdc++-v3/testsuite/tr1/6_containers/headers/functional/synopsis.cc @@ -29,24 +29,5 @@ namespace tr1 { // [6.3.3] Hash function base template template struct hash; - // Hash function specializations - template <> struct hash; - template <> struct hash; - template <> struct hash; - template <> struct hash; - template <> struct hash; - template <> struct hash; - template <> struct hash; - template <> struct hash; - template <> struct hash; - template <> struct hash; - template <> struct hash; - template <> struct hash; - template <> struct hash; - template <> struct hash; - template struct hash; - template <> struct hash; - template <> struct hash; - } // namespace tr1 } // namespace std