Commit Graph

4463 Commits

Author SHA1 Message Date
Benjamin Kosnik 2a5d011c41 re PR libstdc++/51368 (libstdc++ python pretty printers should use --with-python-dir just like libjava)
2012-02-15  Benjamin Kosnik  <bkoz@redhat.com>

	PR libstdc++/51368
	* acinclude.m4 (GLIBCXX_ENABLE_PYTHON): New.
	* configure.ac: Use it.
	* python/Makefile.am: Same.
	* configure: Regenerate.
	* python/Makefile.in: Regenerate.
	* Makefile.in: Same.
	* doc/Makefile.in: Same.
	* include/Makefile.in: Same.
	* po/Makefile.in: Same.
	* src/Makefile.in: Same.
	* src/c++11/Makefile.in: Same.
	* src/c++98/Makefile.in: Same.
	* testsuite/Makefile.in: Same.

Co-Authored-By: Jonathan Wakely <jwakely.gcc@gmail.com>

From-SVN: r184282
2012-02-15 19:56:07 +00:00
Richard Henderson b2cb69647e PR libstdc++/51798 continued
PR libstdc++/51798 continued
	* include/bits/shared_ptr_base.h
	(_Sp_counted_base<_S_atomic>::_M_add_ref_lock): Hoist initial load
	outside compare_exchange loop.
	* include/tr1/shared_ptr.h: Same.
	* include/parallel/compatibility.h (__compare_and_swap_32): Use strong
	version of compare_exchange.
	(__compare_and_swap_64): Same.
	* include/profile/impl/profiler_state.h (__gnu_profile::__turn): Same.
	* libsupc++/guard.cc (__cxa_guard_acquire): Same.

From-SVN: r184171
2012-02-13 13:30:31 -08:00
Benjamin Kosnik 75cee7c62a PR libstdc++/51798 continued.
2012-02-10  Benjamin Kosnik  <bkoz@redhat.com>
            Jonathan Wakely  <jwakely.gcc@gmail.com>

	PR libstdc++/51798 continued.
	* acinclude.m4 (GLIBCXX_ENABLE_ATOMIC_BUILTINS): Use __atomic_*
	builtins instead of __sync_* builtins for atomic functionality.
	* include/bits/shared_ptr_base.h: Same.
	* include/parallel/compatibility.h: Same.
	* include/profile/impl/profiler_state.h: Same.
	* include/tr1/shared_ptr.h: Same.
	* libsupc++/eh_ptr.cc: Same.
	* libsupc++/eh_throw.cc: Same.
	* libsupc++/eh_tm.cc: Same.
	* libsupc++/guard.cc: Same.
	* configure: Regenerated.
	* testsuite/20_util/shared_ptr/cons/43820_neg.cc: Adjust line numbers.

Co-Authored-By: Jonathan Wakely <jwakely.gcc@gmail.com>

From-SVN: r184110
2012-02-10 18:20:43 +00:00
Jonathan Wakely b59cbd5034 re PR libstdc++/51296 (Several 30_threads tests FAIL on Tru64 UNIX)
libgcc/

	PR libstdc++/51296
	PR libstdc++/51906
	* gthr-posix.h: Allow static initializer macros to be disabled.
	(__gthrw_pthread_cond_init): Define weak reference unconditionally.

libstdc++-v3/

	PR libstdc++/51296
	* include/std/mutex (__mutex_base::~__mutex_base): Declare noexcept.
	* src/c++11/condition_variable.cc (condition_variable): Use macro for
	initializer function.

	PR libstdc++/51906
	* config/os/bsd/darwin/os_defines.h: Disable static initializer for
	recursive mutexes.

From-SVN: r183955
2012-02-07 09:19:27 +00:00
François Dumont 74345dec22 2012-02-06 François Dumont <fdumont@gcc.gnu.org>
* include/debug/safe_iterator.h
	(_Safe_iterator::_M_before_dereferenceable): Avoid the expensive
	creation of a _Safe_iterator instance to do the check.

From-SVN: r183941
2012-02-06 20:19:44 +00:00
Jonathan Wakely be38506d7c re PR libstdc++/52104 (go1 fails to run on Solaris 10/11 x86 with with gld)
PR libstdc++/52104
	* include/std/future (__future_base::_Async_state_common): Define
	destructor inline for targets without TLS.
	* src/c++11/future.cc (__future_base::_Async_state_common): Only
	define destructor for TLS targets.

From-SVN: r183920
2012-02-05 23:55:51 +00:00
Jeffrey Yasskin cee8c7a274 re PR c++/52119 ([C++11] overflow in signed left shift isn't diagnosed)
2012-02-05  Jeffrey Yasskin  <jyasskin@gcc.gnu.org>
	    Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/52119
	* include/std/limits (__glibcxx_min): Fix to avoid undefined behavior.

From-SVN: r183905
2012-02-05 12:58:51 +00:00
Benjamin Kosnik 4035739819 re PR libstdc++/51811 ([C++0x] Incorrect increment/decrement of atomic pointers)
2012-02-03  Benjamin Kosnik  <bkoz@redhat.com>

	PR libstdc++/51811
	* include/bits/atomic_base.h (atomic<_Tp*>): Fix offsets.
	* testsuite/29_atomics/atomic/operators/51811.cc: New.
	* testsuite/29_atomics/atomic/operators/pointer_partial_void.cc: New.

From-SVN: r183875
2012-02-03 19:49:11 +00:00
Jonathan Wakely 488b3e6573 re PR libstdc++/49204 ([C++0x] remaining issues in <future>)
PR libstdc++/49204
	* include/std/future (__future_base::_State_base::wait()): Use lambda
	expression for predicate and remove redundant test.
	(__future_base::_State_base::wait_for()): Return future_status and
	use lambda expression for predicate.
	(__future_base::_State_base::wait_until()): Likewise.
	(__basic_future::wait_for(), __basic_future::wait_until()): Likewise.
	(__future_base::_Async_state): Replace with _Async_state_common
	class for non-dependent functionality and _Async_state_impl class
	template for dependent functionality.
	(__future_base::_Async_state_common::_M_join): Serialize attempts to
	join thread.
	(__future_base::_Async_state_common::_M_run_deferred): Join.
	(__future_base::_Async_state::_M_do_run): Replace with lambda.
	* src/c++11/future.cc (__future_base::_Async_state_common): Define
	destructor, so key function is in the library.
	* config/abi/pre/gnu.ver: Add exports for ~_Async_state_common.
	* testsuite/30_threads/packaged_task/members/get_future.cc: Expect
	future_status return instead of bool.
	* testsuite/30_threads/shared_future/members/wait_until.cc: Likewise.
	* testsuite/30_threads/shared_future/members/wait_for.cc: Likewise.
	* testsuite/30_threads/future/members/wait_until.cc: Likewise.
	* testsuite/30_threads/future/members/wait_for.cc: Likewise.
	* testsuite/30_threads/promise/members/set_value2.cc: Likewise.
	* testsuite/30_threads/promise/members/set_value3.cc: Likewise.
	* testsuite/30_threads/promise/members/swap.cc: Likewise.

From-SVN: r183788
2012-02-01 00:20:08 +00:00
Paolo Carlini d9c257a7e2 re PR libstdc++/51795 (linear_congruential_engine doesn't work correctly)
2012-01-27  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/51795
	* include/bits/random.h (linear_congruential_generator): Add
	static_assert preventing instantiation for values of 'a' and 'm'
	currently handled incorrectly but _Mod::__calc.
	* include/bits/random.tcc (seed_seq::generate): Avoid unsafe
	uses of _Mod::__calc.

From-SVN: r183655
2012-01-27 23:30:28 +00:00
Jakub Jelinek 7dcbaaa984 re PR libstdc++/51798 (libstdc++ atomicity performance regression due to __sync_fetch_and_add)
PR libstdc++/51798
	* config/cpu/generic/atomicity_builtins/atomicity.h
	(__exchange_and_add, __atomic_add): Use __atomic_fetch_add
	with __ATOMIC_ACQ_REL semantics instead of __sync_fetch_and_add.
	* include/ext/atomicity.h (__exchange_and_add, __atomic_add):
	Likewise.

From-SVN: r183644
2012-01-27 21:26:03 +01:00
Richard Henderson e29137fe36 libstdc++: Use __GCC_ATOMIC_TEST_AND_SET in atomic_flag.
* include/bits/atomic_base.h (__atomic_flag_base): Define _M_i
        based on the value of __GCC_ATOMIC_TEST_AND_SET_TRUEVAL.
        (ATOMIC_FLAG_INIT): Initialize with 0, not false.
        (atomic_flag::atomic_flag): Use __GCC_ATOMIC_TEST_AND_SET_TRUEVAL.

From-SVN: r183582
2012-01-26 13:50:52 -08:00
Benjamin Kosnik 8bae34da8a [multiple changes]
2012-01-20  Benjamin Kosnik  <bkoz@redhat.com>

	PR libstdc++/49829
	Add libc++98convenience.la, libc++11convenience.la.
	* src/c++98: New directory.
	* src/c++11: New directory.
	* acinclude.m4: (GLIBCXX_CONFIGURE): Add src-c++98, src-c++11.
	* configure: Regenerated.
	* Makefile.am (hosted_source): Add src-c++98, src-c++11 to SUBDIRS.
	* Makefile.in: Regenerate.
	* libsupc++/Makefile.am (AM_CXXFLAGS): USe XTEMPLATE_FLAGS for
	-fno-implicit-templates.
	* libsupc++/Makefile.in: Regenerate.
	* src/Makefile.am (inst_sources): Move... C++11 files into
	separate directory for libstdc++11convenience.la. Files are:
	fstream-inst.cc, string-inst.cc, wlocale-inst.cc, wstring-inst.cc).
	(sources): Move C++11 files. Files are: compatibility-c++0x.cc,
	compatibility-atomic-c++0x.cc, debug.cc, functexcept.cc,
	functional.cc, hash_c++0x.cc, hashtable_c++0x.cc, limits.cc,
	system_error.cc, placeholders.cc, regex.cc, shared_ptr.cc,
	mutex.cc, condition_variable.cc, chrono.cc, thread.cc, future.cc.
	(libstdc++convenience.la): Add new target.
	(SUBDIRS): Add c++11, c++98.
	* src/Makefile.in: Regenerate.
	* src/c++11/Makefile.am: New.
	* src/c++11/Makefile.in: Generate.
	* src/c++98/Makefile.am: New, C++98 files.
	* src/c++98/Makefile.in: Generate.

2012-01-23  Benjamin Kosnik  <bkoz@redhat.com>

	PR libstdc++/49829
	Add libc++98convenience.la, libc++11convenience.la.
	* src/c++98: New directory.
	* src/c++11: New directory.
	* acinclude.m4: (GLIBCXX_CONFIGURE): Add src-c++98, src-c++11.
	* configure: Regenerated.
	* Makefile.am (hosted_source): Add src-c++98, src-c++11 to SUBDIRS.
	* Makefile.in: Regenerate.
	* libsupc++/Makefile.am (AM_CXXFLAGS): USe XTEMPLATE_FLAGS for
	-fno-implicit-templates.
	* libsupc++/Makefile.in: Regenerate.
	* src/Makefile.am (inst_sources): Move... C++11 files into
	separate directory for libstdc++11convenience.la. Files are:
	fstream-inst.cc, string-inst.cc, wlocale-inst.cc, wstring-inst.cc).
	(sources): Move C++11 files. Files are: compatibility-c++0x.cc,
	compatibility-atomic-c++0x.cc, debug.cc, functexcept.cc,
	functional.cc, hash_c++0x.cc, hashtable_c++0x.cc, limits.cc,
	system_error.cc, placeholders.cc, regex.cc, shared_ptr.cc,
	mutex.cc, condition_variable.cc, chrono.cc, thread.cc, future.cc.
	(libstdc++convenience.la): Add new target.
	(SUBDIRS): Add c++11, c++98.
	* src/Makefile.in: Regenerate.
	* src/c++11/Makefile.am: New.
	* src/c++11/Makefile.in: Generate.
	* src/c++98/Makefile.am: New, C++98 files.
	* src/c++98/Makefile.in: Generate.

From-SVN: r183457
2012-01-23 23:12:01 +00:00
Jakub Jelinek ac1384b7c5 re PR libstdc++/51845 (23_containers/unordered_multimap/erase/24061-multimap.cc segfault)
PR libstdc++/51845
	* include/bits/hashtable.h
	(_Hashtable<>::erase(const_iterator, const_iterator)): Also update
	_M_buckets[__n_bkt] if __is_bucket_begin.

	* testsuite/23_containers/unordered_multimap/erase/51845-multimap.cc:
	New test.

From-SVN: r183300
2012-01-19 11:46:31 +01:00
François Dumont 66b432fd29 re PR libstdc++/51866 ([c++0x][4.7 Regression] unordered_multiset compares moved-out values)
2012-01-18  François Dumont  <fdumont@gcc.gnu.org>
	    Roman Kononov  <roman@binarylife.net>

	PR libstdc++/51866
	* include/bits/hashtable.h (_Hashtable<>::_M_insert(_Arg, false_type)):
	Do not keep a reference to a potentially moved instance.
	* testsuite/23_containers/unordered_multiset/insert/51866.cc: New.
	* testsuite/23_containers/unordered_multimap/insert/51866.cc: New.

Co-Authored-By: Roman Kononov <roman@binarylife.net>

From-SVN: r183285
2012-01-18 20:17:57 +00:00
Benjamin Kosnik 43fe49ecf1 configure.ac (BUILD_EPUB): Adjust for epub3.
2012-01-17  Benjamin Kosnik  <bkoz@redhat.com>

	* configure.ac (BUILD_EPUB): Adjust for epub3.
	* configure: Regenerate.
	* Makefile.in: Same.
	* doc/Makefile.am (stamp-epub-docbook): Update for epub3.
	* doc/Makefile.in: Regenerate.
	* include/Makefile.in: Same.
	* libsupc++/Makefile.in: Same.
	* po/Makefile.in: Same.
	* python/Makefile.in: Same.
	* src/Makefile.in: Same.
	* testsuite/Makefile.in: Same.

	* doc/xml/manual/documentation_hacking.xml: Update.

From-SVN: r183263
2012-01-17 23:39:21 +00:00
Jonathan Wakely af7b9e82d0 * include/bits/stl_iterator.h (reverse_iterator): Doxygen comments.
From-SVN: r183182
2012-01-14 17:47:18 +00:00
François Dumont f86b266c7c hashtable_policy.h (_Hash_node_base): New, use it as base class of ...
2012-01-13  François Dumont  <fdumont@gcc.gnu.org>

	* include/bits/hashtable_policy.h (_Hash_node_base): New, use it as
	base class of ...
	(_Hash_node<Value, true>, _Hash_node<Value, false>): ... those.
	* include/bits/hashtable.h (_Hashtable): Replace _M_begin_bucket_index
	by _M_before_begin. Review implementation so that we do not need to
	look for previous non-empty bucket when inserting nodes.

From-SVN: r183164
2012-01-13 21:49:14 +00:00
Benjamin Kosnik 4f7c82dcdb fragment.am (WARN_CXXFLAGS): Add -Wabi.
2012-01-09  Benjamin Kosnik  <bkoz@redhat.com>

	* fragment.am (WARN_CXXFLAGS): Add -Wabi.
	* Makefile.in: Regenerate.
	* doc/Makefile.in: Same.
	* include/Makefile.in: Same.
	* libsupc++/Makefile.in: Same.
	* src/Makefile.in: Same.
	* testsuite/Makefile.in: Same.
	* po/Makefile.in: Same.
	* python/Makefile.in: Same.

From-SVN: r183034
2012-01-09 21:50:18 +00:00
François Dumont f7d6ad0a5c hashtable_policy.h (_Hashtable_base<>::_M_eq()): protected rather than private, use it...
2012-01-05  François Dumont  <fdumont@gcc.gnu.org>

	* include/bits/hashtable_policy.h (_Hashtable_base<>::_M_eq()):
	protected rather than private, use it...
	* include/bits/hashtable.h (_Hashtable<>::key_eq()): ... here.
	* testsuite/23_containers/unordered_set/observers.cc: New.
	* testsuite/23_containers/unordered_multiset/observers.cc: New.
	* testsuite/23_containers/unordered_map/observers.cc: New.
	* testsuite/23_containers/unordered_multimap/observers.cc: New.

From-SVN: r182928
2012-01-05 20:59:17 +00:00
François Dumont 346afd846b hashtable_policy.h (_Ebo_helper<>): Rename to the more specific _Hashtable_ebo_helper.
2012-01-03  François Dumont <fdumont@gcc.gnu.org>

	* include/bits/hashtable_policy.h (_Ebo_helper<>): Rename to the more
	specific _Hashtable_ebo_helper. Hide this implementation detail thanks
	to private inheritance.

From-SVN: r182857
2012-01-03 20:33:20 +00:00
Paolo Carlini f32fd5aaec re PR libstdc++/51711 (regex.h contains incorrect code)
2011-12-30  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/51711
	* include/bits/regex.h (regex_replace): Fix thinko.
	* testsuite/28_regex/algorithms/regex_replace/char/51711.cc: New.
	* testsuite/28_regex/algorithms/regex_replace/wchar_t/51711.cc:
	Likewise.

From-SVN: r182740
2011-12-30 11:40:37 +00:00
Paolo Carlini cc74ac5dbc hashtable_policy.h (struct _Ebo_helper<>): Don't use _N, badname on Solaris; minor stylistic changes.
2011-12-29  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/bits/hashtable_policy.h (struct _Ebo_helper<>): Don't use
	_N, badname on Solaris; minor stylistic changes.

From-SVN: r182734
2011-12-29 22:04:16 +00:00
François Dumont a188284c61 re PR libstdc++/51608 ([C++11] Unordered containers end(size_type) isn't constant time)
2011-12-29  François Dumont <fdumont@gcc.gnu.org>

	PR libstdc++/51608
	* include/bits/hashtable_policy.h (_Equal_helper<>): New, change the
	way the _Equal functor is used depending on whether hash code is
	cached or not.
	(_Ebo_helper<>): New helper type to introduce EBO when possible.
	(_Hash_code_base): Use _Ebo_helper to limit memory footprint. Move
	_Equal functor management...
	(_Hashtable_base): ...here, new, use _Equal_helper.
	(_Local_iterator_base<>, _Locale_iterator<>, _Locale_const_iterator<>):
	New, use _Hash_code_base, implementation of...
	* include/bits/hashtable.h (_Hashtable<>::local_iterator,
	_Hashtable<>::const_local_iterator): ...those. Add static assertions
	checking that some functors are empty depending on whether hash code
	is cache or not.
	(_Hashtable<>::_M_bucket_index): New overloads using current bucket
	count, use through out the _Hastable<> implementation.
	* include/bits/unordered_set.h (__unordered_set<>,
	__unordered_multiset<>): Cache hash code iff hash functor is not
	empty and not final.
	* include/bits/unordered_map.h (__unordered_map<>,
	__unordered_multimap<>): Likewise.
	* include/debug/unordered_map
	(unordered_map<>::_S_to_local, unordered_multimap<>::_S_to_local):
	Adapt to match new local iterator implementation.
	* include/debug/unordered_set (unordered_set<>::_S_to_local,
	unordered_multiset<>::_S_to_local): Likewise.
	* include/profile/unordered_map (unordered_map<>::_M_profile_destruct,
	unordered_multimap<>::_M_profile_destruct): Enhance thanks to usage of
	local iterators.
	* include/profile/unordered_set (unordered_set<>::_M_profile_destruct,
	unordered_multiset<>::_M_profile_destruct): Likewise.
	* testsuite_files/23_containers/unordered_set/instantiation_neg.cc:
	Fix error line.
	* testsuite_files/23_containers/unordered_set/final_hash.cc: New.
	* testsuite_files/23_containers/unordered_multiset/final_hash.cc: New.
	* testsuite_files/23_containers/unordered_map/final_hash.cc: New.
	* testsuite_files/23_containers/unordered_multimap/final_hash.cc: New.

From-SVN: r182727
2011-12-29 17:58:51 +00:00
Jonathan Wakely 94dcac11e5 * include/c_global/cinttypes: Update comments that refer to TR1.
From-SVN: r182659
2011-12-23 17:20:44 +00:00
Jonathan Wakely 7e98765e75 re PR libstdc++/49204 ([C++0x] remaining issues in <future>)
PR libstdc++/49204
	* include/std/future (future_errc): Implement LWG 2056.

From-SVN: r182658
2011-12-23 16:10:48 +00:00
Jonathan Wakely 2ae90de665 regex.h (match_results::size_type): Use allocator_traits.
* include/bits/regex.h (match_results::size_type): Use
	allocator_traits.

From-SVN: r182645
2011-12-23 01:47:41 +00:00
Jonathan Wakely d8ab827382 re PR libstdc++/51365 (cannot use final empty class in std::tuple)
PR libstdc++/51365
	* include/std/tuple (_Tuple_impl): Check __is_final as well as
	is_empty.
	* testsuite/20_util/tuple/51365.cc: New.

From-SVN: r182523
2011-12-20 09:09:50 +00:00
Paolo Carlini 92637e93ed re PR libstdc++/51558 (Declaration of unspecialized std::hash<_Tp>::operator()(_Tp) turns compile-time errors into link-time errors)
2011-12-15  Paolo Carlini  <paolo.carlini@oracle.com>
	    Jonathan Wakely  <jwakely.gcc@gmail.com>

	PR libstdc++/51558
	* include/bits/functional_hash.h (struct hash): Add static_assert.
	* src/compatibility-c++0x.cc: Adjust compatibility definitions.
	* testsuite/23_containers/unordered_map/erase/51142.cc: Adjust.
	* testsuite/23_containers/unordered_set/erase/51142.cc: Likewise.
	* testsuite/23_containers/unordered_multimap/erase/51142.cc: Likewise.
	* testsuite/23_containers/unordered_multiset/erase/51142.cc: Likewise.

Co-Authored-By: Jonathan Wakely <jwakely.gcc@gmail.com>

From-SVN: r182392
2011-12-15 22:15:21 +00:00
Jonathan Wakely d36971dd86 re PR libstdc++/51540 (doxygen documentation for partial_sum misleading)
PR libstdc++/51540
	* include/bits/stl_numeric.h (partial_sum): Adjust doxygen comments.

From-SVN: r182359
2011-12-15 09:49:59 +00:00
Benjamin Kosnik 7897a1c029 user.cfg.in: Add macros, directories.
2011-12-10  Benjamin Kosnik  <bkoz@redhat.com>

	* doc/doxygen/user.cfg.in: Add macros, directories.
	* include/bits/locale_classes.h: Remove doxygen warnings, fix markup.
	* include/bits/locale_classes.tcc: Same.
	* include/bits/shared_ptr.h: Same.
	* include/bits/stl_algo.h: Same.
	* include/bits/stl_list.h: Same.
	* include/bits/stl_numeric.h: Same.
	* include/debug/safe_base.h: Same.
	* include/parallel/equally_split.h: Same.
	* include/std/bitset: Same.
	* include/std/complex: Same.
	* include/std/fstream: Same.
	* include/std/istream: Same.
	* include/std/ostream: Same.
	* include/tr2/dynamic_bitset: Same.
	* scripts/run_doxygen: Remove munging for names that no longer exist.

	* testsuite/23_containers/list/requirements/dr438/assign_neg.cc:
	Adjust line numbers.
	* testsuite/23_containers/list/requirements/dr438/
	constructor_1_neg.cc: Same.
	* testsuite/23_containers/list/requirements/dr438/
	constructor_2_neg.cc: Same.
	* testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same.

From-SVN: r182189
2011-12-10 15:33:06 +00:00
François Dumont f431d7ca38 unordered_set: Minor formatting changes.
2011-12-12  François Dumont <fdumont@gcc.gnu.org>

	* include/profile/unordered_set: Minor formatting changes.
	(unordered_set<>::_M_profile_destruct,
	unordered_multiset<>::_M_profile_destruct): Fix implementation to not
	rely on normal implementation details anymore.
	(unordered_set<>::_M_profile_resize,
	unordered_multiset<>::_M_profile_resize): Implement consistently
	accross all unordered containers.
	(unordered_set<>::emplace, unordered_set<>::emplace_hint,
	unordered_multiset<>::emplace, unordered_multset<>::emplace_hint): Add
	to signal rehash to profiling system.
	* include/profile/unordered_map: Likewise for unordered_map<> and
	unordered_multimap<>.

From-SVN: r182188
2011-12-10 14:00:03 +00:00
François Dumont 9b81593bbc hashtable.h (_Hashtable<>::emplace, [...]): Add.
2011-12-09  François Dumont <fdumont@gcc.gnu.org>

	* include/bits/hashtable.h (_Hashtable<>::emplace,
	_Hashtable<>::emplace_hint): Add.
	* include/debug/unordered_set (unordered_set<>::emplace,
	unordered_set<>::emplace_hint, unordered_multiset<>::emplace,
	unordered_multiset<>::emplace_hint): Add.
	* include/profile/unordered_set: Likewise.
	* include/debug/unordered_map (unordered_map<>::emplace,
	unordered_map<>::emplace_hint, unordered_multimap<>::emplace,
	unordered_multimap<>::emplace_hint): Add.
	* include/profile/unordered_map: Likewise.
	* testsuite/23_containers/unordered_map/modifiers/emplace.cc: New.
	* testsuite/23_containers/unordered_multimap/modifiers/emplace.cc:
	New.
	* testsuite/23_containers/unordered_set/modifiers/emplace.cc: New.
	* testsuite/23_containers/unordered_multiset/modifiers/emplace.cc:
	New.
	* testsuite/util/testsuite_container_traits.h
	(traits_base::has_emplace): Add and defined as std::true_type for
	unordered containers.
	* testsuite/util/exception/safety.h (emplace, emplace_hint): Add and
	use them in basic_safety exception test case.
	* doc/xml/manual/status_cxx2011.xml: Update unordered containers
	status.

From-SVN: r182174
2011-12-09 20:01:04 +00:00
Jonathan Wakely 3d0c32fe56 atomic_base.h (__calculate_memory_order): Rename to...
* include/bits/atomic_base.h (__calculate_memory_order): Rename to...
	(__cmpexch_failure_order): This, and rewrite as constexpr function.
	(compare_exchange_strong, compare_exchange_weak): Use it.
	* include/std/atomic (compare_exchange_strong, compare_exchange_weak):
	Likewise.

From-SVN: r182105
2011-12-08 09:44:57 +00:00
François Dumont 95c0a8a714 re PR libstdc++/51386 (23_containers/unordered_set/hash_policy/load_factor.cc execution timeout)
2011-12-07  François Dumont <fdumont@gcc.gnu.org>

	PR libstdc++/51386
	* include/bits/hashtable_policy.h (_Prime_rehash_policy::_M_next_bkt):
	Fix computation of _M_prev_resize so that hashtable do not keep on
	being rehashed when _M_max_load_factor is lower than 1.

From-SVN: r182085
2011-12-07 19:47:03 +00:00
Paolo Carlini 8535715d0f re PR libstdc++/51438 (std::exception and derived classes are not compatible with std::nested_exception and C++11 in general)
2011-12-06  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/51438
	* libsupc++/nested_exception.h (nested_exception::~nested_exception):
	Declare noexcept.
	* libsupc++/nested_exception.cc: Adjust.
	* testsuite/18_support/nested_exception/51438.cc: New.
	* testsuite/18_support/nested_exception/throw_with_nested.cc: Adjust.
	* testsuite/18_support/nested_exception/rethrow_if_nested.cc:
	Likewise.

	* src/shared_ptr.cc: Use noexcept where appropriate.
	* include/std/system_error: Likewise.
	* include/std/functional: Likewise.
	* include/bits/shared_ptr_base.h: Likewise.
	* src/stdexcept.cc: Use _GLIBCXX_USE_NOEXCEPT where appropriate.
	* include/std/stdexcept: Likewise.
	* libsupc++/bad_cast.cc: Likewise.
	* libsupc++/bad_typeid.cc: Likewise.
	* libsupc++/eh_exception.cc: Likewise.
	* libsupc++/typeinfo: Likewise.
	* libsupc++/exception: Likewise.
	* libsupc++/eh_ptr.cc: Likewise.
	* libsupc++/bad_alloc.cc: Likewise.
	* libsupc++/exception_ptr.h: Likewise.

	* include/std/chrono: Use noexcept where appropriate.
	* src/chrono.cc: Likewise.

From-SVN: r182064
2011-12-06 20:03:25 +00:00
Jonathan Wakely 62b547b5f6 re PR libstdc++/51183 (pair piecewise_construct_t constructor copies)
2011-12-06  Jonathan Wakely  <jwakely.gcc@gmail.com>
	    Chris Jefferson  <chris@bubblescope.net>

	PR libstdc++/51183
	* include/std/stl_pair.h (pair<>::__cons, pair<>::__do_cons): Remove.
	(pair<>::pair(piecewise_construct_t, tuple<>, tuple<>): Only declare.
	(pair<>::pair(tuple<>&, tuple<>&, _Index_tuple<>, _Index_tuple<>)):
	Declare.
	* include/std/tuple (pair<>::__cons, pair<>::__do_cons): Remove.
	(pair<>::pair(tuple<>&, tuple<>&, _Index_tuple<>, _Index_tuple<>)):
	Define.
	(pair<>::pair(piecewise_construct_t, tuple<>, tuple<>): Define,
	delegating to the latter.
	* testsuite/20_util/pair/piecewise2.cc: New.

Co-Authored-By: Chris Jefferson <chris@bubblescope.net>

From-SVN: r182054
2011-12-06 15:13:04 +00:00
Jonathan Wakely 13901e4b28 type_traits: Doxygen improvements.
* include/std/type_traits: Doxygen improvements.
	* include/bits/move.h: Likewise.
	* include/tr1/type_traits:  Likewise.
	* include/tr2/type_traits:  Likewise.
	* testsuite/20_util/declval/requirements/1_neg.cc: Adjust dg-error
	line numbers
	* testsuite/20_util/forward/c_neg.cc: Likewise.
	* testsuite/20_util/forward/f_neg.cc: Likewise.
	* testsuite/20_util/make_signed/requirements/typedefs_neg.cc:
	Likewise.
	* testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc:
	Likewise.

From-SVN: r181993
2011-12-04 16:53:17 +00:00
Markus Trippelsdorf e13afbace1 stl_heap.h (pop_heap): Check for non-empty range in overload taking a predicate.
* include/bits/stl_heap.h (pop_heap): Check for non-empty range in
	overload taking a predicate.
	* testsuite/25_algorithms/pop_heap/empty2_neg.cc: New.

Co-Authored-By: Jonathan Wakely <jwakely.gcc@gmail.com>

From-SVN: r181987
2011-12-04 13:21:53 +00:00
Jonathan Wakely a8028a3ee8 macros.h (__glibcxx_check_non_empty_range): Define.
* include/debug/macros.h (__glibcxx_check_non_empty_range): Define.
	* include/debug/debug.h (__glibcxx_requires_non_empty_range): Define.
	* include/debug/formatter.h (__msg_non_empty_range): Add.
	* src/debug.cc: Message text for __msg_non_empty_range.
	* include/bits/stl_heap.h (pop_heap): Check for non-empty range.
	* testsuite/25_algorithms/pop_heap/empty_neg.cc: New.

From-SVN: r181970
2011-12-03 15:35:35 +00:00
Paolo Carlini f5ca3c3408 iomanip (put_money): Fix thinko, use __err local, like in, eg, basic_ostream::_M_insert.
2011-12-02  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/std/iomanip (put_money): Fix thinko, use __err local,
	like in, eg, basic_ostream::_M_insert.

From-SVN: r181931
2011-12-02 17:23:08 +00:00
Benjamin Kosnik a152e96f01 acinclude.m4 (GLIBCXX_ENABLE_ATOMIC_BUILTINS): Remove size-specific macros.
2011-11-30  Benjamin Kosnik  <bkoz@redhat.com>

        * acinclude.m4 (GLIBCXX_ENABLE_ATOMIC_BUILTINS): Remove
        size-specific macros. _GLIBCXX_ATOMIC_BUILTINS_1,
        _GLIBCXX_ATOMIC_BUILTINS_2, _GLIBCXX_ATOMIC_BUILTINS_4,
        _GLIBCXX_ATOMIC_BUILTINS_8. Use _GLIBCXX_ATOMIC_BUILTINS to
        indicate use of C++11 atomic builtins.
        * config.h.in: Regenerate.
        * configure: Regenerate.
        * include/Makefile.am (bits_sup_headers): Add atomic_lockfree_defines.h.
        * include/Makefile.in: Regenerate.
        * libsupc++/Makefile.am: Compile C++11 support with -std=gnu++0x.
        * libsupc++/Makefile.in: Regenerate.

        * include/bits/atomic_base.h: Move lock-free property macros...
        * libsupc++/atomic_lockfree_defines.h: ...here.
        * include/std/future: Use C++11 macros.
        * libsupc++/eh_ptr.cc: Same.
        * libsupc++/eh_throw.cc: Same.
        * libsupc++/exception: Same.
        * libsupc++/exception_ptr.h: Same.
        * libsupc++/guard.cc: Same.
        * libsupc++/nested_exception.cc: Same.
        * libsupc++/nested_exception.h: Same.
        * src/future.cc: Same.

        * include/ext/atomicity.h: Use _GLIBCXX_ATOMIC_BUILTINS.

        * doc/doxygen/user.cfg.in
        * doc/xml/manual/concurrency_extensions.xml

        * testsuite/18_support/exception_ptr/lifespan.cc
        * testsuite/lib/libstdc++.exp

From-SVN: r181869
2011-12-01 02:20:32 +00:00
François Dumont 40207762a8 hashtable.h (_Hashtable<>::_M_rehash): Remove code useless now that the hashtable implementation put the hash code in...
2011-11-29  François Dumont <fdumont@gcc.gnu.org>

	* include/bits/hashtable.h (_Hashtable<>::_M_rehash): Remove code
	useless now that the hashtable implementation put the hash code in
	cache if the hash functor throws.
	* testsuite/23_containers/unordered_set/erase/1.cc: Enhance test by
	checking also distance between begin and end iterators to validate
	underlying data model.
	* testsuite/23_containers/unordered_multiset/erase/1.cc: Likewise.
	* testsuire/23_containers/unordered_map/erase/1.cc: Likewise.
	* testsuite/23_containers/unordered_multimap/erase/1.cc: Likewise.
	* testsuite/23_containers/unordered_multiset/erase/2.cc: New.
	* testsuite/23_containers/unordered_multimap/erase/2.cc: New.

From-SVN: r181799
2011-11-29 07:45:58 +00:00
Andrew MacLeod 62bad7cd05 c-family
* c-cpp-builtin.c (cpp_atomic_builtins):New.  Emit all atomic
	predefines in one place.  Add LOCK_FREE predefines.
	(c_cpp_builtins): Move Legacy HAVE_SYNC predefines to
	new func.

	libstdc++-v3
	* include/bits/atomic_base.h (ATOMIC_*_LOCK_FREE): Use new cpp
	predefined macros.
	* testsuite/29_atomics/headers/atomic/macros.cc: Add BOOL and POINTER
	macro checks.  Check for expected compile time values.

From-SVN: r181784
2011-11-28 20:28:23 +00:00
Paolo Carlini 1a30353af8 re PR libstdc++/51288 ([C++0x] get_money implementation is missing the sentry object (does not skip leading whitespace))
2011-11-28  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/51288
	* include/std/iomanip (get_money, put_money): Use sentry.
	* testsuite/27_io/manipulators/extended/get_money/char/51288.cc: New.
	* testsuite/27_io/manipulators/extended/get_money/wchar_t/51288.cc:
	Likewise.
	* testsuite/27_io/manipulators/extended/put_money/char/51288.cc:
	Likewise.
	* testsuite/27_io/manipulators/extended/put_money/wchar_t/51288.cc:
	Likewise.

From-SVN: r181775
2011-11-28 13:24:23 +00:00
François Dumont da29608a7a re PR libstdc++/41975 ([C++0x] [DR579] unordered_set::erase performs worse when nearly empty)
2011-11-23  François Dumont <fdumont@gcc.gnu.org>

	PR libstdc++/41975
	* include/bits/hashtable.h (_Hashtable<>): Major data model
	modification to limit performance impact of empty buckets in
	erase(iterator) implementation.
	* include/bits/hashtable_policy.h (_Hashtable_iterator,
	_Hashtable_const_iterator): Remove not used anymore.
	* include/bits/hashtable_policy.h (_Prime_rehash_policy): Remove
	_M_grow_factor, just use natural evolution of prime numbers. Add
	_M_prev_size to know when the number of buckets can be reduced.
	* include/bits/unordered_set.h (__unordered_set<>,
	__unordered_multiset<>), unordered_map.h (__unordered_map<>,
	__unordered_multimap<>): Change default value of cache hash code
	template parameter, false for integral types with noexcept hash
	functor, true otherwise.
	* include/debug/unordered_map, unordered_set: Adapt transformation
	from iterator/const_iterator to respectively
	local_iterator/const_local_iterator.
	* testsuite/performance/23_containers/copy_construct/unordered_set.cc:
	New.
	* testsuite/23_containers/unordered_set/instantiation_neg.cc: New.
	* testsuite/23_containers/unordered_set/hash_policy/rehash.cc: New.
	* testsuite/23_containers/unordered_multiset/cons/copy.cc: New.
	* testsuite/23_containers/unordered_multiset/erase/1.cc,
	24061-multiset.cc: Add checks on the number of bucket elements.
	* testsuite/23_containers/unordered_multiset/insert/multiset_range.cc,
	multiset_single.cc, multiset_single_move.cc: Likewise.

From-SVN: r181677
2011-11-23 20:30:18 +00:00
Jonathan Wakely e02a544331 functional (is_placeholder, [...]): Add partial specializations for cv-qualified types.
* include/std/functional (is_placeholder, is_bind_expression): Add
	partial specializations for cv-qualified types.
	* include/tr1/functional (is_placeholder, is_bind_expression): Add
	partial specializations for std::bind and std::placeholders and for
	cv-qualified types.
	* testsuite/20_util/bind/cv_quals_3.cc: New.
	* testsuite/tr1/3_function_objects/bind/cv_quals.cc: New.
	* testsuite/tr1/3_function_objects/bind/mixed.cc: New.

From-SVN: r181607
2011-11-22 00:40:47 +00:00
Daniel Krugler 5db25ab107 re PR libstdc++/51185 ([C++0x] false-positive results of std::is_constructible)
2011-11-21  Daniel Krugler  <daniel.kruegler@googlemail.com>

	PR libstdc++/51185
	* include/std/type_traits (__is_base_to_derived_ref,
	__is_lvalue_to_rvalue_ref): Fix.
	* testsuite/20_util/is_constructible/51185.cc: New.
	* testsuite/20_util/is_constructible/value-2.cc: Extend.

From-SVN: r181557
2011-11-21 11:21:13 +00:00
Paolo Carlini a7cd7b6088 tuple (__conv_types, [...]): Remove.
2011-11-21  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/std/tuple (__conv_types, __one_by_one_convertible,
	__all_convertible): Remove.
	(tuple<>::tuple(_UElements&&...),
	tuple<>::tuple(const tuple<_UElements...>&),
	tuple<>::tuple(tuple<_UElements...>&&)): Remove wa for c++/48322.

From-SVN: r181555
2011-11-21 10:47:37 +00:00
Jason Merrill c67dd25689 re PR c++/48322 ([C++0x] Plural variadic parameter packs are not expanded well)
PR c++/48322
gcc/cp/
	* cp-tree.h (PACK_EXPANSION_EXTRA_ARGS): New.
	* cp-tree.def (EXPR_PACK_EXPANSION): Add an operand for it.
	* pt.c (tsubst_pack_expansion): Set and use it.
	(iterative_hash_template_arg): Hash it.
	(template_args_equal): Compare it.
	(comp_template_args_with_info): Handle nulls.
	* tree.c (cp_walk_subtrees): Walk it.
	* typeck.c (structural_comptypes): Compare it.
	* ptree.c (cxx_print_type): Print it.
libstdc++-v3/
	* include/std/tuple (tuple(_UElements&&...)): Fix SFINAE.

From-SVN: r181547
2011-11-20 21:04:54 -05:00