Commit Graph

4319 Commits

Author SHA1 Message Date
Paolo Carlini
750867b7f4 re PR c++/49813 ([C++0x] sinh vs asinh vs constexpr)
2011-08-01  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/49813
	* include/c_global/cmath (isinf): Remove workaround.

From-SVN: r177070
2011-08-01 19:26:39 +00:00
Paolo Carlini
3096f51bf6 re PR libstdc++/49925 ([C++0x] ADL bug mixing boost::shared_ptr and std::make_shared<>)
2011-07-31  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/49925
	* include/bits/shared_ptr.h (make_shared): Qualify allocate_shared
	with std::.
	* include/bits/shared_ptr_base.h (__make_shared): Likewise.

From-SVN: r176985
2011-07-31 20:28:45 +00:00
Paolo Carlini
fa45990097 re PR c++/49813 ([C++0x] sinh vs asinh vs constexpr)
2011-07-27  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/49813
	* include/c_global/cmath: Use _GLIBCXX_CONSTEXPR and constexpr.

From-SVN: r176847
2011-07-27 19:33:51 +00:00
Benjamin Kosnik
9bc13c238d array (at): Remove constexpr when -fno-exceptions.
2011-07-25  Benjamin Kosnik  <bkoz@redhat.com>

	* include/std/array (at): Remove constexpr when -fno-exceptions.
	* testsuite/23_containers/array/at_neg.cc: Test.

From-SVN: r176780
2011-07-26 04:21:57 +00:00
Paolo Carlini
cc2ba8e30f re PR libstdc++/49836 ([C++0x] vector<T>::push_back() should not require T to be (move-)assignable)
2011-07-25  Paolo Carlini  <paolo.carlini@oracle.com>
	    Nathan Ridge  <zeratul976@hotmail.com>

	PR libstdc++/49836
	* include/bits/stl_vector.h (vector<>::_M_emplace_back_aux):
	Declare.
	(vector<>::push_back(const value_type&)): Use it.
	* include/bits/vector.tcc: Define.
	(vector<>::emplace_back(_Args&&...)): Use it.
	* testsuite/util/testsuite_tr1.h (CopyConsOnlyType, MoveConsOnlyType):
	Add.
	* testsuite/23_containers/vector/modifiers/push_back/49836.cc: New.
	* testsuite/23_containers/deque/modifiers/push_back/49836.cc:
	Likewise.
	* testsuite/23_containers/deque/modifiers/push_front/49836.cc:
	Likewise.
	* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
	Adjust dg-error line number.
	* testsuite/23_containers/vector/requirements/dr438/insert_neg.cc:
	Likewise.
	* testsuite/23_containers/vector/requirements/dr438/
	constructor_1_neg.cc: Likewise.
	* testsuite/23_containers/vector/requirements/dr438/
	constructor_2_neg.cc: Likewise.

Co-Authored-By: Nathan Ridge <zeratul976@hotmail.com>

From-SVN: r176761
2011-07-25 17:08:48 +00:00
Paolo Carlini
73645647f9 hashtable_policy.h (_Prime_rehash_policy::_M_next_bkt, [...]): Fix typos in the last commit.
2011-07-24  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/bits/hashtable_policy.h (_Prime_rehash_policy::_M_next_bkt,
	_M_bkt_for_elements, _M_need_rehash): Fix typos in the last commit.

From-SVN: r176718
2011-07-24 19:47:04 +00:00
François Dumont
4f7b188f20 hashtable_policy.h (_Prime_rehash_policy): Use __builtin_floor rather than __builtin_ceil to compute next resize value.
2011-07-24  François Dumont  <francois.cppdevs@free.fr>

        * include/bits/hashtable_policy.h (_Prime_rehash_policy): Use
        __builtin_floor rather than __builtin_ceil to compute next resize
        value.
        * testsuite/23_containers/unordered_set/hash_policy/load_factor.cc:
        New.

From-SVN: r176717
2011-07-24 19:20:26 +00:00
Benjamin Kosnik
9b9e81a0a9 move.h (move, forward): Mark constexpr.
2011-07-22  Benjamin Kosnik  <bkoz@redhat.com>
	    Daniel Krugler  <daniel.kruegler@googlemail.com>

	* include/bits/move.h (move, forward): Mark constexpr.
	* include/bits/stl_pair.h (pair): Mark move ctors constexpr.
	* testsuite/20_util/pair/make_pair/constexpr.cc: New.
	* testsuite/20_util/pair/cons/constexpr.cc: Add tests.


Co-Authored-By: Daniel Krugler <daniel.kruegler@googlemail.com>

From-SVN: r176672
2011-07-23 03:17:11 +00:00
Ian Lance Taylor
4ebb4fbf5d fragment.am (CONFIG_CXXFLAGS): Add -frandom-seed.
* fragment.am (CONFIG_CXXFLAGS): Add -frandom-seed.
	* Makefile.in: Rebuild.
	* doc/Makefile.in: Rebuild.
	* include/Makefile.in: Rebuild.
	* libsupc++/Makefile.in: Rebuild.
	* po/Makefile.in: Rebuild.
	* python/Makefile.in: Rebuild.
	* src/Makefile.in: Rebuild.
	* testsuite/Makefile.in: Rebuild.

From-SVN: r176626
2011-07-22 13:52:51 +00:00
François Dumont
364c862b4d safe_unordered_sequence.h, [...]: Rename respectively in...
2011-07-21  François Dumont  <francois.cppdevs@free.fr>

        * include/debug/safe_unordered_sequence.h,
        safe_unordered_sequence.tcc: Rename respectively in...
        * include/debug/safe_unordered_container.h,
        safe_unordered_container.tcc: ...those. _Safe_unordered_sequence
        rename _Safe_unordered_container.
        * include/debug/safe_unordered_base.h: _Safe_unordered_sequence_base
        rename _Safe_unordered_container_base.
        * include/debug/unordered_map, unordered_set: Adapt to previous
        modifications.
        * config/abi/pre/gnu.ver: Likewise.
        * src/debug.cc: Likewise.
        * include/Makefile.am: Likewise.
        * include/Makefile.in: Regenerate.

From-SVN: r176584
2011-07-21 19:56:36 +00:00
Paolo Carlini
2224b91ac5 mutex (timed_mutex, [...]): Update to use steady_clock instead of monotonic_clock.
2011-07-21  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/std/mutex (timed_mutex, recursive_timed_mutex): Update
	to use steady_clock instead of monotonic_clock.
	* config/abi/pre/gnu.ver: Export steady_clock::now.

From-SVN: r176560
2011-07-21 11:09:56 +00:00
Benjamin Kosnik
bfef3a711a array (array::at, [...]): Mark constexpr.
2011-07-20  Benjamin Kosnik  <bkoz@redhat.com>
	    Daniel Krugler  <daniel.kruegler@googlemail.com>

	* include/std/array (array::at, array::operator[]): Mark constexpr.
	* testsuite/23_containers/array/requirements/
	constexpr_element_access.cc: Add.


Co-Authored-By: Daniel Krugler <daniel.kruegler@googlemail.com>

From-SVN: r176550
2011-07-21 05:48:03 +00:00
Benjamin Kosnik
1b97ec17bc chrono: (system_clock::is_steady): Update to N3291 from is_monotonic.
2011-07-20  Benjamin Kosnik  <bkoz@redhat.com>
	    Daniel Krugler  <daniel.kruegler@googlemail.com>

	* include/std/chrono: (system_clock::is_steady): Update to N3291
	from is_monotonic.
	(time_point): Add constexpr to nonmember arithmetic operators.
	* src/chrono.cc: Modify for above.
	* src/compatibility-c++0x.cc: Same.
	* testsuite/20_util/time_point/nonmember/constexpr.cc: New.
	* testsuite/20_util/time_point/1.cc: Modify.
	* testsuite/20_util/system_clock/constexpr_data.cc: Modify.
	* testsuite/20_util/system_clock/1.cc: Modify.
	* testsuite/20_util/monotonic_clock/constexpr_data.cc: Move to...
	* testsuite/20_util/steady_clock/constexpr_data.cc: ...here.
	* testsuite/30_threads/condition_variable/members/2.cc: Modify.
	* testsuite/30_threads/condition_variable_any/members/2.cc: Modify.

From-SVN: r176549
2011-07-21 03:27:51 +00:00
Paolo Carlini
cd88bb8c77 system_error: Use noexcept.
2011-07-20  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/std/system_error: Use noexcept.
	* src/system_error.cc: Likewise.
	* testsuite/19_diagnostics/error_condition/modifiers/39881.cc: Adjust.
	* testsuite/19_diagnostics/error_condition/cons/39881.cc: Likewise.
	* testsuite/19_diagnostics/error_code/modifiers/39882.cc: Likewise.
	* testsuite/19_diagnostics/error_code/cons/39882.cc: Likewise.
	* testsuite/util/testsuite_error.h: Likewise.

	* include/std/system_error (error_code::error_code(_ErrorCodeEnum)):
	Use enable_if on template parameter default.
	(error_condition::error_condition(_ErrorConditionEnum)): Likewise.

From-SVN: r176529
2011-07-20 18:17:30 +00:00
Ed Smith-Rowland
7715bf1b5b stdc++.h: Add scoped_allocator.
2011-07-20  Ed Smith-Rowland  <3dw4rd@verizon.net>

	* include/precompiled/stdc++.h: Add scoped_allocator.

From-SVN: r176520
2011-07-20 15:45:55 +00:00
Benjamin Kosnik
07be61200c bitset (operator[]): Make constexpr.
2011-07-20  Benjamin Kosnik  <bkoz@redhat.com>

	* include/std/bitset (operator[]): Make constexpr.
	* testsuite/23_containers/bitset/operations/constexpr.cc: New.

From-SVN: r176519
2011-07-20 15:44:18 +00:00
Paolo Carlini
d28d43815b safe_local_iterator.h (_Safe_local_iterator<>:: _Safe_local_iterator(const _Iterator&, size_type, const _Sequence*)): Fix typo.
2011-07-20  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/debug/safe_local_iterator.h (_Safe_local_iterator<>::
	_Safe_local_iterator(const _Iterator&, size_type, const _Sequence*)):
	Fix typo.

From-SVN: r176500
2011-07-20 09:40:11 +00:00
François Dumont
77e0bf4e07 safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators.
2011-07-19  François Dumont  <francois.cppdevs@free.fr>

        * include/debug/safe_unordered_base.h, safe_unordered_sequence.h,
        safe_unordered_sequence.tcc, safe_local_iterator.h,
        safe_local_iterator.tcc: New, support for unordered sequence safe
        local iterators.
        * include/Makefile.am: Add previous files.
        * include/Makefile.in: Regenerate.
        * include/debug/unordered_map, unordered_set: Implement
        _Safe_unordered_sequence and expose _Safe_local_iterator.
        * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor
        _Safe_iterator::_M_get_distance static method to expose it as
        __get_distance function and use it in _Safe_local_iterator type.
        * include/debug/formatter.h: Add __msg_local_iter_compare_bad
        _Debug_msg_id enum entry to notify invalid comparison between local
        iterators from different buckets. Add _Parameter constructor from
        _Safe_local_iterator.
        * include/debug/functions.h: Add __valid_range overload for
        _Safe_local_iterator.
        * src/debug.cc: Add _Safe_unordered_sequence_base and
        _Safe_local_iterator_base methods implementations.
        * config/abi/pre/gnu.ver: Add export of some
        _Safe_unordered_sequence_base and _Safe_local_iterator_base methods.
        * testsuite/util/debug/checks.h: Add use_invalid_iterator function to
        simulate use of a singular iterator.
        * testsuite/util/debug/unordered_checks.h: New, several functions
        to simulate classic invalid usage of unordered sequence local
        iterators.
        * testsuite/23_containers/unordered_map/debug/
        use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc,
        use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc,
        invalid_local_iterator_compare_neg.cc: New.
        * testsuite/23_containers/unordered_multimap/debug/
        use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc,
        use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc,
        invalid_local_iterator_compare_neg.cc: New.
        * testsuite/23_containers/unordered_set/debug/
        use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc,
        use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc,
        invalid_local_iterator_compare_neg.cc: New.
        * testsuite/23_containers/unordered_multiset/debug/
        use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc,
        use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc,
        invalid_local_iterator_compare_neg.cc: New.

From-SVN: r176487
2011-07-19 19:39:45 +00:00
Paolo Carlini
9992d56429 re PR libstdc++/48430 (std::hash partial specialization for std::unique_ptr and std::shared_ptr are using unary_function)
2011-07-18  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/48430
	* include/bits/shared_ptr.h (struct hash<shared_ptr<>>): Use
	__hash_base.
	* include/bits/unique_ptr.h (struct hash<unique_ptr<>>): Likewise.

From-SVN: r176405
2011-07-18 16:07:24 +00:00
Paolo Carlini
848ca96f30 re PR libstdc++/49559 ([C++0x] stable_sort calls self-move-assignment operator)
2011-07-11  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/49559
	* include/bits/stl_algo.h (__move_merge_backward): Remove.
	(__move_merge_adaptive, __move_merge_adaptive_backward): New.
	(__merge_adaptive): Use the latter two.
	(__rotate_adaptive): Avoid self move-assignment.
	* include/bits/stl_algobase.h (move_backward): Fix comment.
	* testsuite/25_algorithms/stable_sort/49559.cc: New.
	* testsuite/25_algorithms/inplace_merge/49559.cc: Likewise.
	* testsuite/25_algorithms/inplace_merge/moveable.cc: Extend.
	* testsuite/25_algorithms/inplace_merge/moveable2.cc: Likewise.
	* testsuite/util/testsuite_rvalref.h (rvalstruct::operator=
	(rvalstruct&&)): Check for self move-assignment.

From-SVN: r176174
2011-07-11 18:38:54 +00:00
Jonathan Wakely
677aad9c92 Makefile.am: Add new header.
2011-07-09  Jonathan Wakely  <jwakely.gcc@gmail.com>

	* include/Makefile.am: Add new header.
	* include/Makefile.in: Regenerate.
	* include/std/scoped_allocator: New.
	* doc/xml/manual/status_cxx200x.xml: Update.
	* testsuite/20_util/scoped_allocator/1.cc: New.
	* testsuite/20_util/scoped_allocator/propagation.cc: New.
	* testsuite/20_util/scoped_allocator/requirements/typedefs.cc: New.
	* testsuite/20_util/scoped_allocator/requirements/
	explicit_instantiation.cc: New.

From-SVN: r176079
2011-07-09 14:45:56 +01:00
Jonathan Wakely
bd8485dc9f stl_vector.h: Use new allocator model in C++0x mode.
2011-07-09  Jonathan Wakely  <jwakely.gcc@gmail.com>

	* include/bits/stl_vector.h: Use new allocator model in C++0x mode.
	* include/bits/vector.tcc: Likewise.
	* testsuite/util/testsuite_allocator.h (propagating_allocator): Define.
	* testsuite/23_containers/vector/allocator/copy_assign.cc: New.
	* testsuite/23_containers/vector/allocator/noexcept.cc: New.
	* testsuite/23_containers/vector/allocator/copy.cc: New.
	* testsuite/23_containers/vector/allocator/swap.cc: New.
	* testsuite/23_containers/vector/allocator/move_assign.cc: New.
	* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
	Adjust dg-error line numbers.
	* testsuite/23_containers/vector/requirements/dr438/insert_neg.cc:
	Likewise.
	* testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc:
	Likewise.
	* testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc:
	Likewise.

From-SVN: r176078
2011-07-09 14:06:29 +01:00
Jonathan Wakely
d526242cd8 alloc_traits.h (__allocator_always_compares_equal): New trait, provide partial specializations for known allocators.
2011-07-09  Jonathan Wakely  <jwakely.gcc@gmail.com>

	* include/ext/alloc_traits.h (__allocator_always_compares_equal): New
	trait, provide partial specializations for known allocators.
	(__alloc_traits::construct, __alloc_traits::destroy): Overload for
	non-standard pointer types.
	(__alloc_traits::_S_always_equal): New trait for use with noexcept.
	(__alloc_traits::_S_nothrow_move): Likewise.
	(__alloc_traits::_S_nothrow_swap): Likewise.

From-SVN: r176077
2011-07-09 13:48:32 +01:00
Jonathan Wakely
eece716393 cast.h: Fix typo in include guard.
2011-07-09  Jonathan Wakely  <jwakely.gcc@gmail.com>

	* include/ext/cast.h: Fix typo in include guard.
	* include/ext/pointer.h (_Unqualified_type): Remove redundant
	partial specializations for volatile types. Fix typos in comments.
	(pointer_traits<_Pointer_adaptor<Tp>>::pointer_to): Define.

From-SVN: r176075
2011-07-09 11:28:56 +01:00
Jonathan Wakely
4880236e3f re PR libstdc++/49668 ([C++0x] std::thread does not forward its args as rvalues)
2011-07-09  Jonathan Wakely  <jwakely.gcc@gmail.com>

	PR libstdc++/49668
	* include/std/functional (__bind_simple): Define.
	* include/std/future (_Task_setter): Parameterize by type of result
	pointer instead of state object.
	(_S_task_setter): Type deduction helper.
	(_Task_state): Use _S_task_setter and __bind_simple.
	(_Deferred_state, _Async_state): Store call wrapper directly not as
	std::function. Use _S_task_setter and __bind_simple.
	(_S_make_deferred_state, _S_make_async_state): Type deduction helpers.
	(async): Use new functions and __bind_simple.
	* include/std/mutex (call_once): Use __bind_simple.
	* include/std/thread (thread): Likewise. Remove unused headers.
	* src/thread.cc: Add header.
	* testsuite/30_threads/async/49668.cc: New.
	* testsuite/30_threads/call_once/49668.cc: New.
	* testsuite/30_threads/thread/cons/49668.cc: New.
	* testsuite/30_threads/thread/cons/moveable.cc: Remove unused bool.

From-SVN: r176073
2011-07-09 11:13:01 +01:00
Rainer Orth
00fc1bf6c7 configure.host (abi_baseline_subdir_switch): Describe.
* configure.host (abi_baseline_subdir_switch): Describe.
	Provide default.
	(*-*-solaris2.[89], *-*-solaris2.1[0-9]): Override.
	* acinclude.m4 (GLIBCXX_CONFIGURE_TESTSUITE): Substitute
	baseline_subdir_switch.
	* testsuite/Makefile.am (site.exp): Emit it.
	(baseline_subdir): Use it.
	* testsuite/libstdc++-abi/abi.exp: Use it.
	* configure: Regenerate.
	* Makefile.in: Regenerate.
	* doc/Makefile.in: Regenerate.
	* include/Makefile.in: Regenerate.
	* libsupc++/Makefile.in: Regenerate.
	* po/Makefile.in: Regenerate.
	* python/Makefile.in: Regenerate.
	* src/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.

From-SVN: r176032
2011-07-08 08:49:57 +00:00
François Dumont
4c2d93dbfa set.h, [...]: Remove base class default constructor calls.
2011-06-29  François Dumont  <francois.cppdevs@free.fr>

	* include/debug/set.h, unordered_map, multiset.h, forward_list,
	unordered_set, vector, deque, string, list, multimap.h: Remove base
	class default constructor calls.
	* include/debug/map.h: Likewise and cleanup several redefinition of
	base iterator typedef.

From-SVN: r175665
2011-06-29 20:11:50 +00:00
Paolo Carlini
98656b3d14 pat_trie_base.hpp: Avoid -Wall warning.
2011-06-22  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/ext/pb_ds/detail/pat_trie_/pat_trie_base.hpp: Avoid -Wall
	warning.

From-SVN: r175321
2011-06-22 22:28:56 +00:00
Paolo Carlini
bd9db3b8dd stl_construct.h: Update Copyright years.
2011-06-22  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/bits/stl_construct.h: Update Copyright years.
	* include/bits/stl_uninitialized.h: Likewise.

From-SVN: r175309
2011-06-22 20:27:21 +00:00
Jonathan Wakely
e8eb60bd92 Makefile.am: Add alloc_traits.h headers.
2011-06-22  Jonathan Wakely  <jwakely.gcc@gmail.com>

	* include/Makefile.am: Add alloc_traits.h headers.
	* include/Makefile.in: Regenerate.
	* include/std/memory: Include uses_allocator.h explicitly.
	* include/bits/allocator.h (allocator_traits): Move to ...
	* include/bits/alloc_traits.h: New header.
	* include/ext/alloc_traits.h (__alloc_traits): Extension to provide
	a common allocator interface for C++98 and C++0x.
	* include/bits/stl_construct.h: Use __alloc_traits.
	* include/bits/stl_uninitialized.h: Likewise.

From-SVN: r175305
2011-06-22 20:57:12 +01:00
Daniel Krugler
ccb4f5a707 move.h (__is_nothrow_swappable): Add.
2011-06-22  Daniel Krugler  <daniel.kruegler@googlemail.com>
	    Paolo Carlini  <paolo.carlini@oracle.com>

	* include/bits/move.h (__is_nothrow_swappable): Add.
	(swap(_Tp(&)[_Nm], _Tp(&)[_Nm])): Use noexcept.
	* include/bits/algorithmfwd.h: Adjust.
	* testsuite/25_algorithms/swap/noexcept.cc: New.


Co-Authored-By: Paolo Carlini <paolo.carlini@oracle.com>

From-SVN: r175277
2011-06-21 23:01:03 +00:00
Daniel Krugler
6f17ef336c tuple (__conv_types, [...]): Add.
2011-06-20  Daniel Krugler  <daniel.kruegler@googlemail.com>
	    Paolo Carlini  <paolo.carlini@oracle.com>

	* include/std/tuple (__conv_types, __one_by_one_convertible,
	__all_convertible): Add.
	(tuple): Use the latter.
	(tuple<_T1>): Remove.
	* testsuite/20_util/uses_allocator/cons_neg.cc: Adjust dg-error
	line number.
	* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Likewise.

Co-Authored-By: Paolo Carlini <paolo.carlini@oracle.com>

From-SVN: r175204
2011-06-20 11:05:45 +00:00
Jonathan Wakely
d2393b3adb ptr_traits.h (pointer_traits<T*>::pointer_to): Use noexcept.
2011-06-14  Jonathan Wakely  <jwakely.gcc@gmail.com>

	* include/bits/ptr_traits.h (pointer_traits<T*>::pointer_to): Use
	noexcept.

From-SVN: r175057
2011-06-14 23:08:24 +01:00
Paolo Carlini
6a97dbf748 valarray (~valarray): Use noexcept.
2011-06-14  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/std/valarray (~valarray): Use noexcept.
	* include/bits/unique_ptr.h (~unique_ptr): Likewise.
	* testsuite/26_numerics/valarray/noexcept_move_construct.cc: New.
	* testsuite/20_util/shared_ptr/cons/noexcept_move_construct.cc:
	Likewise.
	* testsuite/20_util/unique_ptr/cons/noexcept_move_construct.cc:
	Likewise.
	* testsuite/20_util/weak_ptr/cons/noexcept_move_construct.cc:
	Likewise.

From-SVN: r175039
2011-06-14 17:48:29 +00:00
Paolo Carlini
6b14c6d7ff functional: Use noexcept.
2011-06-14  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/std/functional: Use noexcept.
	* include/bits/stl_tempbuf.h: Likewise.

From-SVN: r175026
2011-06-14 15:09:14 +00:00
François Dumont
8a752dfea6 allocator.h (__shrink_to_fit): Rename to __shrink_to_fit_aux, fix.
2011-06-12  François Dumont  <francois.cppdevs@free.fr>
	    Paolo Carlini  <paolo.carlini@oracle.com>

	* include/bits/allocator.h (__shrink_to_fit): Rename to
	__shrink_to_fit_aux, fix.
	* include/bits/stl_vector.h (_M_shrink_to_fit): Declare.
	(shrink_to_fit): Use the latter.
	* include/debug/vector (shrink_to_fit): Likewise.
	* include/bits/vector.tcc (_M_shrink_to_fit): Define.
	* include/bits/stl_deque.h (_M_shrink_to_fit): Declare.
	(shrink_to_fit): Use the latter.
	* include/debug/deque (shrink_to_fit): Likewise.
	* include/bits/deque.tcc (_M_shrink_to_fit): Define.
	* include/bits/vector.tcc (vector<bool>::_M_reallocate): Add.
	* include/bits/stl_bvector.h (_M_shrink_to_fit): Declare.
	(shrink_to_fit): Use the latter.
	(reserve): Use _M_reallocate, move inline.
	(_Bvector_base<>::_S_nword): Add, use it throughout.
	* include/debug/string (shrink_to_fit): Redo.
	* include/ext/vstring.h (shrink_to_fit): Optimize.
	* include/bits/basic_string.h (shrink_to_fit): Likewise.
	* testsuite/21_strings/debug/shrink_to_fit.cc: New.
	* testsuite/23_containers/vector/debug/shrink_to_fit.cc: Likewise.
	* testsuite/23_containers/vector/debug/bool/shrink_to_fit.cc:
	Likewise.
	* testsuite/23_containers/vector/bool/capacity/shrink_to_fit.cc:
	Likewise.
	* testsuite/23_containers/deque/debug/shrink_to_fit.cc: Likewise.



Co-Authored-By: Paolo Carlini <paolo.carlini@oracle.com>

From-SVN: r174967
2011-06-12 15:51:36 +00:00
Jonathan Wakely
c51b58dc1f extptr_allocator.h (construct, destroy): Fix for C++0x mode by overloading to take allocator's pointer type.
2011-06-11  Jonathan Wakely  <jwakely.gcc@gmail.com>

	* include/ext/extptr_allocator.h (construct, destroy): Fix for C++0x
	mode by overloading to take allocator's pointer type.
	* testsuite/23_containers/vector/ext_pointer/types/2.cc: New.
	* testsuite/23_containers/vector/ext_pointer/explicit_instantiation/
	2.cc: New.

From-SVN: r174958
2011-06-11 17:05:08 +01:00
Paolo Carlini
7d9cb05400 throw_allocator.h: Use noexcept.
2011-06-10  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/ext/throw_allocator.h: Use noexcept.
	* include/ext/pool_allocator.h: Likewise.
	* include/ext/bitmap_allocator.h: Likewise.
	* include/ext/new_allocator.h: Likewise.
	* include/ext/malloc_allocator.h: Likewise.
	* include/ext/array_allocator.h: Likewise.
	* include/ext/mt_allocator.h: Likewise.
	* include/ext/extptr_allocator.h: Likewise.
	* testsuite/util/testsuite_allocator.h: Likewise; do not include
	<cassert> directly, include <testsuite_hooks.h> instead.

From-SVN: r174918
2011-06-10 17:14:40 +00:00
Benjamin Kosnik
30a96b3b0c *: Doxygen markup redo.
2011-06-10  Benjamin Kosnik  <bkoz@redhat.com>

	* include/ext/pb_ds/*: Doxygen markup redo.
	* include/Makefile.am: Fold in constructors_destructor_fn_imps.hpp.
	* include/Makefile.in: Regenerate.

From-SVN: r174917
2011-06-10 17:10:42 +00:00
Paolo Carlini
9b3a81dacd type_traits (__is_copy_assignable_impl, [...]): Fix typos.
2011-06-09  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/std/type_traits (__is_copy_assignable_impl,
	__is_nt_copy_assignable_impl): Fix typos.

From-SVN: r174840
2011-06-09 08:03:14 +00:00
Paolo Carlini
545dc5e324 extptr_allocator.h: Include <ext/numeric_traits.h> instead of <limits>.
2011-06-08  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/ext/extptr_allocator.h: Include <ext/numeric_traits.h>
	instead of <limits>.
	* include/bits/allocator.h: Likewise.

	* include/std/chrono (duration_values<>::min): Call lowest, not min.

From-SVN: r174805
2011-06-08 12:12:00 +00:00
Paolo Carlini
76aa78e9eb allocator.h (__shrink_to_fit): Simplify.
2011-06-08  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/bits/allocator.h (__shrink_to_fit): Simplify.
	* include/bits/stl_vector.h (vector<>::shrink_to_fit): Adjust.
	* include/bits/stl_deque.h: Likewise.
	* include/bits/stl_bvector.h: Likewise.

From-SVN: r174802
2011-06-08 11:07:24 +00:00
Paolo Carlini
74a2a1b4f6 move.h (struct __move_if_noexcept_cond): Add.
2011-06-07  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/bits/move.h (struct __move_if_noexcept_cond): Add.
	(move_if_noexcept): Use the latter.
	* include/bits/stl_iterator.h (__make_move_if_noexcept_iterator,
	_GLIBCXX_MAKE_MOVE_IF_NOEXCEPT_ITERATOR): Add.
	* include/bits/stl_uninitialized.h
	(__uninitialized_move_if_noexcept_a): Add.
	* include/bits/vector.tcc (vector<>::reserve): Use
	_GLIBCXX_MAKE_MOVE_IF_NOEXCEPT_ITERATOR.
	(vector<>::_M_insert_aux, _M_fill_insert, _M_default_append,
	_M_range_insert): Use __uninitialized_move_if_noexcept_a.
	* testsuite/23_containers/vector/modifiers/moveable2.cc: New.
	* testsuite/23_containers/vector/capacity/resize/moveable2.cc:
	Likewise.
	* testsuite/23_containers/vector/capacity/reserve/moveable2.cc:
	Likewise.

From-SVN: r174756
2011-06-07 16:11:36 +00:00
Paolo Carlini
7aca3d94be move.h (move_if_noexcept): Use __and_ and __not_.
2011-06-06  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/bits/move.h (move_if_noexcept): Use __and_ and __not_.

From-SVN: r174708
2011-06-06 16:39:29 +00:00
Jonathan Wakely
428319bb9a ptr_traits.h (pointer_traits): Fix typos.
2011-06-05  Jonathan Wakely  <jwakely.gcc@gmail.com>

	* include/bits/ptr_traits.h (pointer_traits): Fix typos.
	* include/ext/pointer.h (pointer_traits): Add partial specialization
	for _Pointer_adapter.

From-SVN: r174661
2011-06-05 21:28:38 +01:00
Paolo Carlini
6f59ea252b hashtable.h (_Hashtable<>::_Hashtable(_Hashtable&&)): Use std::move on the allocator, use noexcept.
2011-06-01  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/bits/hashtable.h (_Hashtable<>::_Hashtable(_Hashtable&&)):
	Use std::move on the allocator, use noexcept.
	(_Hashtable<>::~_Hashtable): Use noexcept.
	* include/bits/stl_list.h: Likewise.
	* include/bits/forward_list.h: Likewise.
	* include/bits/stl_vector.h: Likewise.
	* include/bits/stl_bvector.h: Likewise.
	* include/bits/stl_map.h (map<>::map(map&&)): Use noexcept. 
	* include/bits/stl_set.h: Likewise.
	* include/bits/stl_multimap.h: Likewise.
	* include/bits/stl_multiset.h: Likewise.
	* include/bits/stl_tree.h (_Rb_tree<>::_Rb_tree(_Rb_tree&&)): Use
	std::move on the allocator.
	(_Rb_tree<>::~_Rb_tree): Use noexcept.
	* include/bits/stl_deque.h: Likewise.
	* include/bits/basic_string.h (basic_string<>::~basic_string): Use
	noexcept.
	* include/ext/vstring.h (__versa_string<>::~__versa_string): Likewise.
	* include/debug/set.h: Adjust.
	* include/debug/unordered_map: Likewise.
	* include/debug/multiset.h: Likewise.
	* include/debug/forward_list: Likewise.
	* include/debug/vector: Likewise.
	* include/debug/unordered_set: Likewise.
	* include/debug/deque: Likewise.
	* include/debug/map.h: Likewise.
	* include/debug/string: Likewise.
	* include/debug/list: Likewise.
	* include/debug/multimap.h: Likewise.
	* include/profile/set.h: Likewise.
	* include/profile/unordered_map: Likewise.
	* include/profile/multiset.h: Likewise.
	* include/profile/forward_list: Likewise.
	* include/profile/unordered_set: Likewise.
	* include/profile/vector: Likewise.
	* include/profile/deque: Likewise.
	* include/profile/map.h: Likewise.
	* include/profile/list: Likewise.
	* include/profile/multimap.h: Likewise.
	* testsuite/21_strings/basic_string/cons/wchar_t/
	noexcept_move_construct.cc: New.
	* testsuite/21_strings/basic_string/cons/char/
	noexcept_move_construct.cc: Likewise.
	* testsuite/ext/vstring/cons/noexcept_move_construct.cc: Likewise.
	* testsuite/23_containers/unordered_map/cons/
	noexcept_move_construct.cc: Likewise.
	* testsuite/23_containers/multimap/cons/
	noexcept_move_construct.cc: Likewise.
	* testsuite/23_containers/set/cons/
	noexcept_move_construct.cc: Likewise.
	* testsuite/23_containers/unordered_multimap/cons/
	noexcept_move_construct.cc: Likewise.
	* testsuite/23_containers/forward_list/cons/
	noexcept_move_construct.cc: Likewise.
	* testsuite/23_containers/unordered_set/cons/
	noexcept_move_construct.cc: Likewise.
	* testsuite/23_containers/vector/bool/cons/
	noexcept_move_construct.cc: Likewise.
	* testsuite/23_containers/vector/cons/
	noexcept_move_construct.cc: Likewise.
	* testsuite/23_containers/multiset/cons/
	noexcept_move_construct.cc: Likewise.
	* testsuite/23_containers/list/cons/
	noexcept_move_construct.cc: Likewise.
	* testsuite/23_containers/unordered_multiset/cons/
	noexcept_move_construct.cc: Likewise.
	* testsuite/23_containers/map/cons/noexcept_move_construct.cc
	* testsuite/23_containers/forward_list/requirements/dr438/
	assign_neg.cc: Adjust dg-error line numbers.
	* testsuite/23_containers/forward_list/requirements/dr438/
	insert_neg.cc: Likewise.
	* testsuite/23_containers/forward_list/requirements/dr438/
	constructor_1_neg.cc: Likewise.
	* testsuite/23_containers/forward_list/requirements/dr438/
	constructor_2_neg.cc: Likewise.
	* testsuite/23_containers/vector/requirements/dr438/
	assign_neg.cc: Likewise.
	* testsuite/23_containers/vector/requirements/dr438/
	insert_neg.cc: Likewise.
	* testsuite/23_containers/vector/requirements/dr438/
	constructor_1_neg.cc: Likewise.
	* testsuite/23_containers/vector/requirements/dr438/
	constructor_2_neg.cc: Likewise.
	* testsuite/23_containers/deque/requirements/dr438/
	assign_neg.cc: Likewise.
	* testsuite/23_containers/deque/requirements/dr438/
	insert_neg.cc: Likewise.
	* testsuite/23_containers/deque/requirements/dr438/
	constructor_1_neg.cc: Likewise.
	* testsuite/23_containers/deque/requirements/dr438/
	constructor_2_neg.cc: Likewise.
	* testsuite/23_containers/list/requirements/dr438/
	assign_neg.cc: Likewise.
	* testsuite/23_containers/list/requirements/dr438/
	insert_neg.cc: Likewise.
	* testsuite/23_containers/list/requirements/dr438/
	constructor_1_neg.cc: Likewise.
	* testsuite/23_containers/list/requirements/dr438/
	constructor_2_neg.cc: Likewise.

	* include/bits/move.h (swap): Use __and_ in the noexcept.
	* include/bits/algorithmfwd.h: Adjust.

From-SVN: r174525
2011-06-01 14:16:19 +00:00
Paolo Carlini
cea8c6deef basic_string.h: Use noexcept per the FDIS (minus compare(const string&)...
2011-05-31  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/bits/basic_string.h: Use noexcept per the FDIS (minus
	compare(const string&), which uses char_traits::compare, which
	isn't noexcept; also no noexcept in the move assignment operator
	and move assign, see c++std-lib-30855).
	* include/bits/basic_string.tcc: Likewise.
	* include/ext/vstring.h: Likewise.
	* include/ext/vstring.tcc: Likewise.
	* include/debug/string: Likewise.

From-SVN: r174479
2011-05-31 12:50:31 +00:00
Paolo Carlini
dd7b175ec3 type_traits (__or_, __and_): Add trivial definitions for a single element.
2011-05-30  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/std/type_traits (__or_, __and_): Add trivial definitions
	for a single element.
	* include/bits/stl_pair.h: Use __and_ in noexcept specs and
	constraints.
	(pair<>::pair(pair&&)): Define.
	(pair<>::pair(const pair<>&)): Constrain with is_convertible.
	(pair<>::pair(pair<>&&)): Likewise, remove noexcept.
	* include/std/tuple: Use __and_ in noexcept specs and constraints.
	(_Tuple_impl<>::_Tuple_impl(allocator_arg_t, const _Alloc&,
	_Tuple_impl&&)): Remove noexcept.
	(tuple<>::tuple(_UElements&&...), tuple(const tuple<_UElements...>&),
	tuple(tuple<_UElements...>&&), tuple(const pair<_U1, _U2>&),
	tuple(pair<_U1, _U2>&&)): Constrain with is_convertible.
	* testsuite/20_util/tuple/moveable2.cc: Use = delete.
	* testsuite/20_util/make_signed/requirements/typedefs_neg.cc:
	Adjust dg-error line numbers.
	* testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc:
	Likewise.
	* testsuite/20_util/declval/requirements/1_neg.cc: Likewise.
	* testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Likewise.
	* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Likewise.

From-SVN: r174464
2011-05-31 02:29:22 +00:00
Jonathan Wakely
59d6607d6f tuple: Restore is_convertible constraint.
2011-05-31  Jonathan Wakely  <jwakely.gcc@gmail.com>

	* include/std/tuple: Restore is_convertible constraint.
	* testsuite/20_util/tuple/cons/allocate_noncopyable.cc: Remove.

From-SVN: r174458
2011-05-31 00:46:13 +01:00
Jonathan Wakely
b821466067 tuple: Implement uses-allocator construction.
2011-05-30  Jonathan Wakely  <jwakely.gcc@gmail.com>

	* include/std/tuple: Implement uses-allocator construction.
	* include/bits/allocator.h (uses_allocator): Move to ...
	* include/bits/uses_allocator.h: New file.
	* include/Makefile.am: Add new header.
	* include/Makefile.in: Regenerate.
	* testsuite/20_util/uses_allocator/cons_neg.cc: New.
	* testsuite/20_util/uses_allocator/construction.cc: New.
	* testsuite/20_util/tuple/cons/allocate_noncopyable.cc: New.
	* testsuite/20_util/tuple/cons/allocators.cc: New.

From-SVN: r174443
2011-05-30 17:31:17 +01:00