Commit Graph

68 Commits

Author SHA1 Message Date
Jonathan Wakely 75eb64433e future (__async_result_of): New alias template.
* include/std/future (__async_result_of): New alias template.
	(async): Use __async_result_of to pass decayed types to result_of.
	* testsuite/30_threads/async/lwg2021.cc: New.
	* doc/xml/manual/intro.xml: Document LWG 2021 status.

From-SVN: r223866
2015-05-29 14:44:52 +01:00
Jonathan Wakely e6508eaf69 future (packaged_task(allocator_arg_t, const A&, F&&): Remove explicit (LWG 2407).
* include/std/future (packaged_task(allocator_arg_t, const A&, F&&):
	Remove explicit (LWG 2407).

From-SVN: r223161
2015-05-13 14:54:40 +01:00
Jonathan Wakely f6341d8d09 re PR libstdc++/51617 ([C++0x] async(f) isn't.)
PR libstdc++/51617
	* include/std/future (async): Change default policy to launch::async.

From-SVN: r222793
2015-05-05 02:56:47 +01:00
Jonathan Wakely 664e99eac4 future (future_error(error_code)): Construct base class with error_code's message.
* include/std/future (future_error(error_code)): Construct base
	class with error_code's message.
	* src/c++11/future.cc (future_error::what()): Do not call c_str() on
	temporary string.

From-SVN: r221236
2015-03-06 12:31:43 +00:00
Torvald Riegel eae801bacc libstdc++: Optimize synchronization in std::future if futexes are available.
* src/c++11/futex.cc: New file.
	* include/bits/atomic_futex.h: New file.
	* include/std/future (__future_base::_State_baseV2): Use
	atomic_futex_unsigned instead of mutex+condvar.
	* src/c++11/futex.cc: Likewise.
	* include/Makefile.am: Add atomic_futex.h.
	* include/Makefile.in: Likewise.
	* src/c++11/Makefile.am: Add futex.cc.
	* src/c++11/Makefile.in: Likewise.

From-SVN: r219770
2015-01-16 19:50:43 +00:00
Jakub Jelinek 5624e564d2 Update copyright years.
From-SVN: r219188
2015-01-05 13:33:28 +01:00
Jonathan Wakely 9131b50960 future (__future_base::_Setter::operator(), [...]): Make call operators const.
* include/std/future (__future_base::_Setter::operator(),
	__future_base::_Task_setter::operator()): Make call operators const.

From-SVN: r218553
2014-12-10 00:39:37 +00:00
Jonathan Wakely 103265d611 re PR libstdc++/64168 (FAIL: 30_threads/async/sync.cc execution test)
PR libstdc++/64168
	* include/std/future (_Deferred_state::_M_has_deferred): Fix return.

From-SVN: r218321
2014-12-03 16:09:21 +00:00
Jonathan Wakely 9db7c9316e Define *_at_thread_exit() functions.
* config/abi/pre/gnu.ver: Add new exports.
	* include/std/condition_variable (notify_all_at_thread_exit): Declare.
	(__at_thread_exit_elt): New base class.
	* include/std/future: Add comments documenting the implementation.
	(__future_base::_State_baseV2::_State_baseV2()): Use brace-or-equal
	initializers and define constructor as defaulted.
	(__future_base::_State_baseV2::_M_ready): Replace member function
	with member variable.
	(__future_base::_State_baseV2::_M_set_result): Set _M_ready.
	(__future_base::_State_baseV2::_M_set_delayed_result): Define.
	(__future_base::_State_baseV2::_M_break_promise): Set _M_ready.
	(__future_base::_State_baseV2::_Make_ready): New helper class.
	(__future_base::_Deferred_state::_M_has_deferred): Remove requirement
	for caller to own mutex.
	(__future_base::_Async_state_impl::~_Async_state_impl): Call join
	directly.
	(__future_base::_Task_state_base::_M_run): Take arguments by
	reference.
	(__future_base::_Task_state_base::_M_run_delayed): Declare new pure
	virtual function.
	(__future_base::_Task_state::_M_run_delayed): Define override.
	(promise::set_value_at_thread_exit): Define.
	(promise::set_exception_at_thread_exit): Define.
	(packaged_task::make_ready_at_thread_exit): Define.
	* src/c++11/condition_variable.cc (notify_all_at_thread_exit): Define.
	* src/c++11/future.cc
	(__future_base::_State_baseV2::_Make_ready::_M_set): Define.
	* testsuite/30_threads/condition_variable/members/3.cc: New.
	* testsuite/30_threads/packaged_task/members/at_thread_exit.cc: New.
	* testsuite/30_threads/promise/members/at_thread_exit.cc: New.

From-SVN: r218255
2014-12-02 01:51:25 +00:00
Jonathan Wakely db0b7db338 future (__location_invariant): Move specializations after preprocessor condition.
* include/std/future (__location_invariant): Move specializations
	after preprocessor condition.

From-SVN: r213744
2014-08-07 23:54:53 +01:00
Jonathan Wakely 4e48c10968 future (_State_baseV2::_M_set_result): Pass pointers to _M_do_set.
* include/std/future (_State_baseV2::_M_set_result): Pass pointers to
	_M_do_set.
	(_State_baseV2::_M_do_set): Change parameters to pointers.
	(_State_baseV2::_Setter): Change _M_arg from reference to pointer.
	(_State_baseV2::__setter): Initialize _Setter with pointers.
	(_State_baseV2::__setter(promise<void>*)): Remove overload.
	(promise::set_value, promise::set_exception): Pass setter directly
	to _M_set_result.
	(_State_baseV2::_Task_setter): Add template parameter for callable
	type and replace std::function member with pointer to that type.
	Change _M_result member from reference to pointer.
	(_State_baseV2::_S_task_setter): Change parameter to lvalue reference
	and initialize _Task_setter with pointers.
	(__location_invariant): Specialize for _Setter and _Task_setter.

From-SVN: r213737
2014-08-07 21:13:52 +01:00
Jonathan Wakely b925bf594a Makefile.am: Add new header.
* include/Makefile.am: Add new header.
	* include/Makefile.in: Regenerate.
	* include/bits/allocated_ptr.h (__allocated_ptr, __allocate_guarded):
	New RAII utilities for working with allocators.
	* include/bits/shared_ptr_base.h (_Sp_counted_deleter): Define
	__allocator_type typedef and use new __allocated_ptr type.
	(_Sp_counted_ptr_inplace): Likewise.
	(__shared_count::__shared_count, __shared_ptr::__shared_ptr): Use
	__allocate_guarded to to simplify exception handling.
	* include/experimental/any (any::_Manager_alloc::_S_alloc): Likewise.
	* include/std/future (_Result_alloc::_M_destroy): Likewise.
	(_Result_alloc::_S_allocate_result): Likewise.
	* testsuite/20_util/shared_ptr/cons/43820_neg.cc: Adjust line number.
	* testsuite/20_util/shared_ptr/cons/void_neg.cc: Likewise.
	* testsuite/20_util/shared_ptr/creation/no_rtti.cc: New.
	* testsuite/20_util/shared_ptr/creation/alloc.cc: Test allocator
	with fancy pointer.
	* testsuite/30_threads/promise/cons/alloc.cc: Likewise.

From-SVN: r211996
2014-06-25 21:54:46 +01:00
Jonathan Wakely 315eb4bb08 condition_variable (condition_variable_any::_Unlock): Do not swallow __forced_unwind.
* include/std/condition_variable (condition_variable_any::_Unlock): Do
	not swallow __forced_unwind.
	* include/std/future (__future_base::_Task_setter): Likewise.
	(__future_base::_Async_state_impl): Turn __forced_unwind into broken
	promise and rethrow.
	* include/std/mutex (try_lock): Likewise.
	* testsuite/30_threads/async/forced_unwind.cc: New.
	* testsuite/30_threads/packaged_task/forced_unwind.cc: New.

From-SVN: r211138
2014-06-02 16:45:09 +01:00
Jonathan Wakely a0eaa08ceb re PR libstdc++/60966 (std::call_once sometime hangs)
PR libstdc++/60966
	* include/std/future (__future_base::_State_baseV2::_M_set_result):
	Pass lock into _M_do_set and hold it until the function returns.
	Signal condition variable after call_once completes.
	(__future_base::_State_baseV2::_M_do_set): Use lock argument. Do not
	signal here.
	* testsuite/30_threads/promise/60966.cc: New.

From-SVN: r210556
2014-05-17 13:58:46 +01:00
Jonathan Wakely f7e68d0804 re PR libstdc++/60564 ([C++11] The std::packaged_task constructor taking a reference to a functor does not copy its argument.)
PR libstdc++/60564
	* include/std/future (__future_base::_Task_state<>): Change
	constructors to template functions using perfect forwarding.
	(__create_task_state): Use decayed type as stored task.
	(packaged_task::packaged_task(_Fn&&)): Forward instead of moving.
	* testsuite/30_threads/packaged_task/60564.cc: New.

From-SVN: r208656
2014-03-18 16:31:38 +00:00
Richard Sandiford aa118a03c4 Update copyright years in libstdc++-v3/
From-SVN: r206301
2014-01-02 22:30:10 +00:00
Jonathan Wakely f2f08be7ea re PR libstdc++/49204 ([C++0x] remaining issues in <future>)
PR libstdc++/49204
	* include/std/future (__future_base::_State_base): Rename to
	__future_base::_State_baseV2.
	(__future_base::_State_baseV2::~_State_baseV2): Define as defaulted.
	(__future_base::_State_baseV2::_M_run_deferred): Rename to
	_M_complete_async.
	(__future_base::_State_baseV2::_M_has_deferred): Add new virtual.
	(__future_base::_State_baseV2::wait_for): Call _M_has_deferred() to
	test for a deferred function, or call _M_complete_async() to join an
	async thread that has made the shared state ready.
	(__future_base::_State_baseV2::wait_until): Likewise.
	(__future_base::_Async_state_common): Rename to _Async_state_commonV2.
	(__future_base::_Async_state_commonV2::_M_run_deferred): Rename to
	_M_complete_async.
	* src/c++11/compatibility-thread-c++0x.cc (__future_base::_State_base):
	Export old definition.
	(__future_base::_Async_state_common): Likewise.
	* src/c++11/future.cc (__future_base::_State_base::~_State_base):
	Remove.
	* doc/xml/manual/status_cxx2011.xml: Update status.
	* testsuite/30_threads/async/async.cc: Test future_status::timeout
	and future_status::ready.
	* testsuite/30_threads/async/sync.cc: Test future_status::deferred.

From-SVN: r205144
2013-11-20 20:59:19 +00:00
Jonathan Wakely ec98d01014 re PR libstdc++/56905 ([C++11][DR 1130] std::copy_exception should be removed or no longer be used)
PR libstdc++/56905
	* libsupc++/exception_ptr.h (copy_exception): Deprecate and
	move implementation to make_exception_ptr.
	* include/std/future (_State_base::_M_break_promise): Replace
	copy_exception with make_exception_ptr.
	* testsuite/18_support/exception_ptr/move.cc: Likewise.
	* testsuite/18_support/exception_ptr/rethrow_exception.cc: Likewise.
	* testsuite/30_threads/future/members/get2.cc: Likewise.
	* testsuite/30_threads/promise/members/set_exception.cc: Likewise.
	* testsuite/30_threads/promise/members/set_exception2.cc: Likewise.
	* testsuite/30_threads/promise/members/set_value2.cc: Likewise.
	* testsuite/30_threads/shared_future/members/get2.cc: Likewise.

From-SVN: r198265
2013-04-24 23:00:16 +01:00
Jonathan Wakely f2e2de5f85 Makefile.am: Add ext/aligned_buffer.h
* include/Makefile.am: Add ext/aligned_buffer.h
	* include/Makefile.in: Regenerate.
	* include/ext/aligned_buffer.h: New.
	* include/std/future (_Result): Use __aligned_buffer.
	* include/bits/forward_list.h (_Fwd_list_node): Likewise.
	* include/bits/shared_ptr_base.h (_Sp_counted_ptr_inplace): Likewise.
	* testsuite/20_util/shared_ptr/cons/43820_neg.cc: Adjust dg-error line
	number.

From-SVN: r197554
2013-04-07 17:44:40 +01:00
Jonathan Wakely aaad548e18 re PR libstdc++/56492 (std::packaged_task requires CopyConstructible stored task)
PR libstdc++/56492
	* include/std/future (__future_base::_Result): Add result_type
	typedef.
	(__future_base::_S_allocate_result): Overload for std::allocator.
	(__future_base::_Task_setter): Use _Result::result_type instead of
	deducing the type from the task.
	(__future_base::_Task_state): Store allocator to allow shared state
	to be reset.  Replace std::function with member of target object type
	accessed via ...
	(__future_base::_Task_state_base): New abstract base class.
	(__future_base::_Task_state_base::_M_run): New virtual function to
	invoke type-erased target object.
	(__future_base::_Task_state_base::_M_reset): New virtual function to
	create new shared_state using same target object and allocator.
	(__future_base::__create_task_state): Allocate a new _Task_state.
	(packaged_task::packaged_task): Use __create_task_state.
	(packaged_task::reset): Use _Task_state_base::_M_reset.
	* testsuite/30_threads/packaged_task/cons/56492.cc: New.

From-SVN: r196695
2013-03-16 02:48:06 +00:00
Jonathan Wakely c93fa3ca7e re PR libstdc++/55861 ([C++11] `std::shared_future::get' is not const-qualified)
PR libstdc++/55861
	* include/std/future (_State_base::_S_check(const shared_ptr<T>&)):
	Fix return type.
	(__basic_future::_M_get_result()): Const qualify.
	(shared_future::get()): Likewise.
	* testsuite/30_threads/shared_future/members/get.cc: Use const
	objects.

From-SVN: r195314
2013-01-19 23:42:55 +00:00
Jonathan Wakely 92b8bccecb * include/std/future (__async_sfinae_helper): Remove.
From-SVN: r194567
2012-12-17 21:30:51 +00:00
Jonathan Wakely 1b5dc776ca stl_algo.h (reverse_copy): Update comment per DR 2074.
* include/bits/stl_algo.h (reverse_copy): Update comment per DR 2074.
	* include/bits/unordered_map.h: Apply DR 2005 resolution.
	* doc/xml/manual/status_cxx2011.xml: Update per DR 2048.
	* include/bits/allocator.h (allocator): Apply DR 2103 resolution.
	* include/ext/array_allocator.h: Likewise.
	* include/ext/bitmap_allocator.h: Likewise.
	* include/ext/malloc_allocator.h: Likewise.
	* include/ext/mt_allocator.h: Likewise.
	* include/ext/new_allocator.h: Likewise.
	* include/ext/pool_allocator.h: Likewise.
	* include/ext/throw_allocator.h: Likewise.
	* include/ext/alloc_traits.h (__allocator_always_compares_equal): Add
	additional specializations.
	* include/std/functional: Add comment about DR resolution.
	* include/std/future: Likewise.
	* include/std/scoped_allocator: Likewise.
	* include/std/thread: Likewise.
	* testsuite/20_util/allocator/requirements/typedefs.cc: New.
	* testsuite/20_util/bind/ref_neg.cc: Adjust dg-error line numbers.

From-SVN: r193638
2012-11-19 22:28:00 +00:00
Jonathan Wakely 0ad9f93083 future (atomic_future): Remove declaration of non-standard name.
* include/std/future (atomic_future): Remove declaration of
	non-standard name.

From-SVN: r193457
2012-11-12 23:00:41 +00:00
Jason Merrill 734f50238f * many: Replace uses of __GXX_EXPERIMENTAL_CXX0X__ with __cplusplus.
From-SVN: r193392
2012-11-10 12:27:22 -05:00
Jonathan Wakely 3dd808fe94 re PR libstdc++/54297 ([C++11] Segmentation fault with std::async and released shared state)
PR libstdc++/54297
	* src/c++11/future.cc (~_Async_state_common): Move to...
	* src/c++11/compatibility-thread-c++0x.cc (~_Async_state_common):
	Here.
	(_GLIBCXX_ABI_COMPAT_ASYNC): Rename to _GLIBCXX_ASYNC_ABI_COMPAT.
	* include/std/future (_GLIBCXX_ABI_COMPAT_ASYNC): Likewise.

From-SVN: r190685
2012-08-26 14:49:44 +01:00
Jonathan Wakely 277f43d2d0 re PR libstdc++/54297 ([C++11] Segmentation fault with std::async and released shared state)
PR libstdc++/54297
	* include/std/future (~_Async_state_impl): Join thread before
	derived class members are destroyed.
	(~_Async_state_common): Only define non-trivial destructor when
	included from future.cc for ABI compatibility reasons.
	* src/c++11/future.cc (_GLIBCXX_ABI_COMPAT_ASYNC): Define.
	* testsuite/30_threads/async/54297.cc: New.

From-SVN: r190672
2012-08-26 00:01:40 +01:00
Jonathan Wakely 6e48db73ed memory: Include auto_ptr.h later.
* include/std/memory: Include auto_ptr.h later.
	* include/bits/shared_ptr.h (shared_ptr(auto_ptr<_Up>&&): Remove
	definition.
	* include/bits/shared_ptr_base.h (__shared_ptr(auto_ptr<_Up>&&):
	Likewise.
	* include/bits/unique_ptr.h (unique_ptr(auto_ptr<_Up>&&): Likewise.
	* include/backward/auto_ptr.h (unique_ptr(auto_ptr<_Up>&&): Define.
	(shared_ptr(auto_ptr<_Up>&&, __shared_ptr(auto_ptr<_Up>&&): Likewise.
	* include/std/future: Reduce header dependencies.
	* testsuite/20_util/default_delete/48631_neg.cc: Adjust dg-error line
	numbers.
	* testsuite/20_util/shared_ptr/cons/43820_neg.cc: Likewise.
	* testsuite/20_util/unique_ptr/assign/48635_neg.cc: Likewise.

From-SVN: r190109
2012-08-03 01:27:48 +01: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
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
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
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
Jonathan Wakely a58a38b32c shared_ptr_base.h (_Sp_counted_ptr): Make 'final'.
* include/bits/shared_ptr_base.h (_Sp_counted_ptr): Make 'final'.
	(_Sp_counted_deleter): Make 'final'. Use allocator_traits.
	(_Sp_counted_ptr_inplace): Make 'final'. Use allocator_traits.
	Derive from _Sp_counted_ptr instead of _Sp_counted_deleter to use EBO
	for the allocator.
	(__shared_count, __shared_ptr): Use allocator_traits.
	* include/std/future (__future_base::_Result_alloc): Make 'final'. Use
	allocator traits.
	(__future_base::_Task_state): Make 'final'.
	(__future_base::_Deferred_state): Likewise.
	(__future_base::_Async_state): Likewise.
	* testsuite/20_util/shared_ptr/cons/alloc_min.cc: New.
	* testsuite/20_util/shared_ptr/creation/alloc_min.cc: New.
	* testsuite/20_util/shared_ptr/creation/private.cc: New.
	* testsuite/20_util/shared_ptr/cons/43820_neg.cc: Adjust line numbers.
	* testsuite/30_threads/packaged_task/cons/alloc_min.cc: New.
	* testsuite/30_threads/promise/cons/alloc_min.cc: New.

From-SVN: r181171
2011-11-08 16:45:54 +00:00
Jonathan Wakely c4d9f41936 future (__future_base::_Ptr): Use alias-declaration.
* include/std/future (__future_base::_Ptr): Use alias-declaration.
	(__is_same_pkgdtask): Rename to __constrain_pkgdtask and use decay
	instead of remove_reference so that cv-quals are removed.

From-SVN: r181145
2011-11-08 01:23:53 +00:00
Jonathan Wakely 376d7c51ec future (promise): Add constructors for uses-allocator construction from rvalue promise.
* include/std/future (promise): Add constructors for uses-allocator
	construction from rvalue promise.
	(packaged_task): Implement LWG 2067. Add additional constructors for
	uses-allocator construction.
	* testsuite/30_threads/packaged_task/cons/3.cc: New.
	* testsuite/30_threads/packaged_task/cons/alloc2.cc: New.
	* testsuite/30_threads/promise/cons/alloc2.cc: New.

From-SVN: r180757
2011-11-02 00:53:12 +00:00
Paolo Carlini a4eeb82207 future: constexpr functions are implicitly inline.
2011-08-11  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/std/future: constexpr functions are implicitly inline.
	* include/std/chrono: Likewise.
	* include/std/complex: Likewise.
	* include/bits/move.h: Likewise.
	* include/bits/stl_pair.h: Likewise.

From-SVN: r177679
2011-08-11 17:53:05 +00: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
Jonathan Wakely faa0051112 future (launch): Update enumerators and define operators required for bitmask type.
2011-05-28  Jonathan Wakely  <jwakely.gcc@gmail.com>

	* include/std/future (launch): Update enumerators and define
	operators required for bitmask type. Remove trailing whitespace.
	* src/future.cc: Remove trailing whitespace.
	* testsuite/30_threads/async/any.cc: Adjust.
	* testsuite/30_threads/async/sync.cc: Adjust.
	* testsuite/30_threads/async/launch.cc: New.

From-SVN: r174374
2011-05-28 01:24:11 +01:00
Jonathan Wakely 84b63c01f8 future: Use noexcept.
2011-05-28  Jonathan Wakely  <jwakely.gcc@gmail.com>

	* include/std/future: Use noexcept.
	* src/future.cc: Likewise.

From-SVN: r174368
2011-05-28 00:25:54 +01:00
Jonathan Wakely be7f782278 re PR libstdc++/48521 ([C++0x] std::result_of doesn't work with pointer to member)
2011-04-19  Jonathan Wakely  <jwakely.gcc@gmail.com>

	PR libstdc++/48521
	* include/std/type_traits (result_of): Handle pointer to member.
	* include/std/functional (__invoke): Likewise.
	(_Function_to_function_pointer): Remove.
	(_Reference_wrapper_base): Provide nested types independent of
	unary_function and binary_function.
	(reference_wrapper::operator()): DR 2017.
	(ref(const A&&), cref(const A&&): Define as deleted.
	* include/std/future (async): Simplify SFINAE and use result_of to
	support pointer to member.
	* testsuite/20_util/reference_wrapper/invoke.cc: Test pointer to 
	member.
	* testsuite/20_util/reference_wrapper/24803.cc: Likewise.
	* testsuite/20_util/reference_wrapper/typedefs.cc: Test for types
	instead of derivation from unary_function and binary_function.
	* testsuite/20_util/declval/requirements/1_neg.cc: Adjust.
	* testsuite/20_util/reference_wrapper/invoke-2.cc: New.
	* testsuite/20_util/reference_wrapper/ref_neg.c: New.
	* testsuite/20_util/reference_wrapper/typedefs-3.c: New.

From-SVN: r172709
2011-04-19 14:26:08 +01:00
Jonathan Wakely e3e08a1db5 future (future::share): Add.
2011-03-25  Jonathan Wakely  <jwakely.gcc@gmail.com>

	* include/std/future (future::share): Add.
	(packaged_task::result_type): Remove as per LWG 2030.
	(packaged_task::packaged_task): Remove redundant constructors, as per
	LWG 1514.
	* testsuite/30_threads/future/members/share.cc: New.
	* testsuite/30_threads/packaged_task/requirements/typedefs.cc: Remove.

From-SVN: r171531
2011-03-25 23:16:09 +00:00
Benjamin Kosnik e95992339f Makefile.am: Add functional.cc, shared_ptr.cc.
2011-03-14  Benjamin Kosnik  <bkoz@redhat.com>

	* src/Makefile.am: Add functional.cc, shared_ptr.cc.
	* src/Makefile.in: Regenerate.
	* libsupc++/Makefile.am: Add nested_exception.cc.
	* libsupc++/Makefile.in: Regenerate.
	* src/system_error.cc: Add ctor and dtor definitions for error_category.
	* src/functional.cc: New. Add dtor definition for bad_function_call.
	* src/stdexcept.cc: Add dtor definitions for domain_error,
	invalid_argument, length_error, out_of_range, range_error,
	overflow_error, underflow_error.
	* src/future.cc: Add dtor definition for __future_base::_Result_base.
	* src/shared_ptr.cc: New. Add dtor definition for bad_weak_ptr.
	* src/thread.cc: Add dtor for thread::_Impl_base.
	* include/std/system_error: Adjust.
	* include/std/stdexcept: Same.
	* include/std/future: Same.
	* include/std/functional: Same.
	* include/std/thread: Same.
	* include/bits/shared_ptr_base.h: Same.
	* libsupc++/nested_exception.cc: New. Add dtor for nested_exception.
	* libsupc++/nested_exception.h: Adjust.
	* testsuite/20_util/shared_ptr/cons/43820_neg.cc: Adjust line numbers.
	* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same.
	* config/abi/pre/gnu.ver: Add new exports.

	* include/bits/regex_compiler.h: Nest namespace versioning.
	* include/bits/regex_grep_matcher.tcc: Same.
	* include/bits/regex_grep_matcher.h: Same.
	* include/bits/regex_cursor.h: Same.
	* include/bits/regex_nfa.h: Same.
	* include/bits/regex_nfa.tcc: Same.

From-SVN: r170975
2011-03-15 00:24:08 +00:00
Jonathan Wakely 7a0269ded1 future (packaged_task::operator bool): Rename to...
2011-02-09  Jonathan Wakely  <jwakely.gcc@gmail.com>

	* include/std/future (packaged_task::operator bool): Rename to...
	(packaged_task::valid): ...this.
	* testsuite/30_threads/packaged_task/cons/1.cc: Adjust.
	* testsuite/30_threads/packaged_task/cons/2.cc: Adjust.
	* testsuite/30_threads/packaged_task/cons/move.cc: Adjust.
	* testsuite/30_threads/packaged_task/cons/move_assign.cc: Adjust.
	* testsuite/30_threads/packaged_task/cons/alloc.cc: Adjust.
	* testsuite/30_threads/packaged_task/members/invoke.cc: Adjust.
	* testsuite/30_threads/packaged_task/members/reset.cc: Adjust.
	* testsuite/30_threads/packaged_task/members/reset2.cc: Adjust.
	* testsuite/30_threads/packaged_task/members/swap.cc: Adjust.
	* testsuite/30_threads/packaged_task/members/boolconv.cc: Remove.
	* testsuite/30_threads/packaged_task/members/valid.cc: Add.

From-SVN: r169988
2011-02-09 23:17:05 +00:00
Benjamin Kosnik 12ffa22844 PR libstdc++/36104 part four
2011-01-30  Benjamin Kosnik  <bkoz@redhat.com>

	PR libstdc++/36104 part four
	* include/bits/c++config (_GLIBCXX_STD): Remove.
	(_GLIBCXX_STD_D, _GLIBCXX_PR): Now _GLIBCXX_STD_C.
	(_GLIBCXX_P): Now _GLIBCXX_STD_A.
	(_GLIBCXX_NAMESPACE_DEBUG, _GLIBCXX_NAMESPACE_PARALLEL,
	 _GLIBCXX_NAMESPACE_PROFILE, _GLIBCXX_NAMESPACE_VERSION): Remove.
	(_GLIBCXX_INLINE_DEBUG, _GLIBCXX_INLINE_PARALLEL,
	 _GLIBCXX_INLINE_PROFILE): Remove.
	(_GLIBCXX_BEGIN_NAMESPACE(X)): Remove.
	(_GLIBCXX_END_NAMESPACE): Remove.
	(_GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y)): Remove.
	(_GLIBCXX_END_NESTED_NAMESPACE): Remove.
	(_GLIBCXX_BEGIN_NAMESPACE_ALGO): Add.
	(_GLIBCXX_END_NAMESPACE_ALGO): Add.
	(_GLIBCXX_BEGIN_NAMESPACE_CONTAINER): Add.
	(_GLIBCXX_END_NAMESPACE_CONTAINER): Add.
	(_GLIBCXX_BEGIN_NAMESPACE_VERSION): Add.
	(_GLIBCXX_END_NAMESPACE_VERSION): Add.
	(_GLIBCXX_BEGIN_LDBL_NAMESPACE): To _GLIBCXX_BEGIN_NAMESPACE_LDBL.
	(_GLIBCXX_END_LDBL_NAMESPACE): To _GLIBCXX_END_NAMESPACE_LDBL.
	(_GLIBCXX_VISIBILITY_ATTR): Revert to _GLIBCXX_VISIBILITY.
	* include/*: Use new macros for namespace scope.
	* config/*: Same.
	* src/*: Same.

	* src/Makefile.am (sources): Remove debug_list.cc, add
	compatibility-debug_list-2.cc.
	(parallel_sources): Remove parallel_list.cc, add
	compatibility-parallel_list-2.cc.
	(compatibility-parallel_list-2.[o,lo]): New rule.
	* src/Makefile.in: Regenerate.
	* src/debug_list.cc: Remove.
	* src/parallel_list.cc: Remove.
	* src/compatibility-list-2.cc: New.
	* src/compatibility-debug_list-2.cc: New.
	* src/compatibility-parallel_list-2.cc: New.

	* doc/doxygen/user.cfg.in: Adjust macros.

	* testsuite/20_util/auto_ptr/assign_neg.cc: Adjust line numbers, macros.
	* testsuite/20_util/declval/requirements/1_neg.cc: Same.
	* testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same.
	* testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same.
	* testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same.
	* testsuite/20_util/forward/c_neg.cc: Same.
	* testsuite/20_util/forward/f_neg.cc: Same.
	* testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same.
	* testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same.
	* testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Same.
	* testsuite/20_util/ratio/operations/ops_overflow_neg.cc: Same.
	* testsuite/20_util/shared_ptr/cons/43820_neg.cc: Same.
	* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same.
	* testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same.
	* testsuite/23_containers/deque/requirements/dr438/
	constructor_1_neg.cc: Same.
	* testsuite/23_containers/deque/requirements/dr438/
	constructor_2_neg.cc: Same.
	* testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same.
	* testsuite/23_containers/forward_list/capacity/1.cc: Same.
	* testsuite/23_containers/forward_list/requirements/dr438/
	assign_neg.cc: Same.
	* testsuite/23_containers/forward_list/requirements/dr438/
	constructor_1_neg.cc: Same.
	* testsuite/23_containers/forward_list/requirements/dr438/
	constructor_2_neg.cc: Same.
	* testsuite/23_containers/forward_list/requirements/dr438/
	insert_neg.cc: Same.
	* testsuite/23_containers/list/capacity/29134.cc: Same.
	* testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same.
	* 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.
	* testsuite/23_containers/vector/bool/capacity/29134.cc: Same.
	* testsuite/23_containers/vector/bool/modifiers/insert/31370.cc: Same.
	* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same.
	* testsuite/23_containers/vector/requirements/dr438/
	constructor_1_neg.cc: Same.
	* testsuite/23_containers/vector/requirements/dr438/
	constructor_2_neg.cc: Same.
	* testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same.
	* testsuite/25_algorithms/sort/35588.cc: Same.
	* testsuite/27_io/ios_base/cons/assign_neg.cc: Same.
	* testsuite/27_io/ios_base/cons/copy_neg.cc: Same.
	* testsuite/ext/profile/mutex_extensions_neg.cc: Same.
	* testsuite/ext/profile/profiler_algos.cc: Same.
	* testsuite/ext/type_traits/add_unsigned_floating_neg.cc: Same.
	* testsuite/ext/type_traits/add_unsigned_integer_neg.cc: Same.
	* testsuite/ext/type_traits/remove_unsigned_floating_neg.cc: Same.
	* testsuite/ext/type_traits/remove_unsigned_integer_neg.cc: Same.
	* testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc: Same.

From-SVN: r169421
2011-01-30 22:39:36 +00:00
Benjamin Kosnik f910786b98 *: Use headername alias to associate private includes to public includes.
2010-11-18  Benjamin Kosnik  <bkoz@redhat.com>

	* config/*/*: Use headername alias to associate private includes
	to public includes.
	* include/*/*: Same.

	* scripts/run_doxygen: Update for doxygen 1.7.2.
	* doc/doxygen/user.cfg.in: Same.
	* doc/doxygen/TODO: Remove.

	* testsuite/*/std_c++0x_neg.cc: Adjust line number.

From-SVN: r168046
2010-12-19 09:21:16 +00:00
Jonathan Wakely 5262c72ad4 re PR libstdc++/45133 ([c++0x] std::future will crash with NULL deref if get() is called twice)
2010-12-14  Jonathan Wakely  <jwakely.gcc@gmail.com>

	PR libstdc++/45133
	* include/std/future (__basic_future::wait): Throw if not valid.
	(__basic_future::wait_for): Likewise.
	(__basic_future::wait_until): Likewise.
	(__basic_future::_M_get_result): Likewise.
	* testsuite/30_threads/future/members/45133.cc: New.
	* testsuite/30_threads/shared_future/members/45133.cc: New.

From-SVN: r167823
2010-12-14 23:27:17 +00:00
Benjamin Kosnik 85db9dcc30 chrono: Constexpr markup for is_monotonic.
2010-11-23  Benjamin Kosnik  <bkoz@redhat.com>

	* include/std/chrono: Constexpr markup for is_monotonic.
	* src/chrono.cc: Same.
	* testsuite/20_util/clocks/1.cc: Move...
	* testsuite/20_util/system_clock/1.cc: ...here.
	* testsuite/20_util/system_clock/constexpr_data.cc
	* testsuite/20_util/monotonic_clock/constexpr_data.cc

	* include/std/complex: Mark primary template constexpr.
	* testsuite/26_numerics/complex/cons/constexpr_primary.cc: Add.
	* testsuite/26_numerics/complex/complex_value.cc: Move...
	* testsuite/26_numerics/complex/dr387.cc: Move...
	* testsuite/26_numerics/complex/value_operations/1.cc: ... here.
	* testsuite/26_numerics/complex/value_operations/dr387.cc: ...here.
	* testsuite/26_numerics/complex/value_operations/constexpr.cc: New.

2010-11-23  Benjamin Kosnik  <bkoz@redhat.com>
	    Jason Merrill  <jason@redhat.com>

	* testsuite/lib/libstdc++.exp: Use scanasm.
	* testsuite/util/testsuite_common_types.h
	(constexpr_default_constructible): Add support for non-literal types.
	(constexpr_single_value_constructible): Same.
	* testsuite/20_util/enable_shared_from_this/cons/constexpr.cc:
	Remove xfail.
	* testsuite/20_util/shared_ptr/cons/constexpr.cc: Add.
	* testsuite/20_util/unique_ptr/cons/constexpr.cc: Add.
	* testsuite/20_util/weak_ptr/cons/constexpr.cc: Add.
	* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Adjust line number.

2010-11-23  Benjamin Kosnik  <bkoz@redhat.com>
	    Jonathan Wakely  <jwakely.gcc@gmail.com>

	* include/std/future (shared_future): Default ctor constexpr.
	(future): Same.
	* testsuite/30_threads/shared_future/cons/constexpr.cc: New.
	* testsuite/30_threads/future/cons/constexpr.cc: New.


Co-Authored-By: Jason Merrill <jason@redhat.com>
Co-Authored-By: Jonathan Wakely <jwakely.gcc@gmail.com>

From-SVN: r167099
2010-11-23 23:47:44 +00:00
Paolo Carlini 53dc5044ed cinttypes: Remove, move contents to C++0x and TR1 headers.
2010-11-02  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/tr1_impl/cinttypes: Remove, move contents to C++0x
	and TR1 headers.
	* include/tr1_impl/cstdlib: Likewise.
	* include/tr1_impl/cstdio: Likewise.
	* include/tr1_impl/cctype: Likewise.
	* include/tr1_impl/boost_sp_counted_base.h: Likewise.
	* include/tr1_impl/cmath: Likewise.
	* include/tr1_impl/cfenv: Likewise.
	* include/tr1_impl/utility: Likewise.
	* include/tr1_impl/complex: Likewise.
	* include/tr1_impl/cwchar: Likewise.
	* include/tr1_impl/type_traits: Likewise.
	* include/tr1_impl/cstdint: Likewise.
	* include/tr1_impl/regex: Likewise.
	* include/tr1_impl/array: Likewise.
	* include/tr1_impl/cwctype: Likewise.
	* include/Makefile.am: Adjust.
	* include/Makefile.in: Regenerate.
	* src/condition_variable.cc: Adjust; consistently use
	_GLIBCXX_BEGIN_NAMESPACE and _GLIBCXX_END_NAMESPACE.
	* src/mutex.cc: Likewise.
	* src/future.cc: Likewise.
	* src/atomic.cc: Likewise.
	* src/chrono.cc: Likewise.
	* src/thread.cc: Likewise.
	* include/std/tuple: Likewise.
	* include/std/utility: Likewise.
	* include/std/thread: Likewise.: Likewise.
	* include/std/type_traits: Likewise.
	* include/std/memory: Likewise.
	* include/std/future: Likewise.
	* include/std/ratio: Likewise.
	* include/std/chrono: Likewise.
	* include/std/condition_variable: Likewise.
	* include/std/mutex: Likewise.
	* include/std/functional: Likewise.
	* include/std/complex: Likewise.
	* include/std/typeindex: Likewise.
	* include/std/array: Likewise.
	* include/bits/regex_compiler.h: Likewise.
	* include/bits/regex_grep_matcher.tcc: Likewise.
	* include/bits/regex_grep_matcher.h: Likewise.
	* include/bits/regex_constants.h: Likewise.
	* include/bits/regex_cursor.h: Likewise.
	* include/bits/regex_nfa.tcc: Likewise.
	* include/bits/shared_ptr_base.h: Likewise.
	* include/bits/regex_nfa.h: Likewise.
	* include/bits/random.tcc: Likewise.
	* include/bits/regex.h: Likewise.
	* include/bits/random.h: Likewise.
	* include/bits/regex_error.h: Likewise.
	* include/c_global/cinttypes: Likewise.
	* include/c_global/cstdlib: Likewise.
	* include/c_global/cstdio: Likewise.
	* include/c_global/cctype: Likewise.
	* include/c_global/cmath: Likewise.
	* include/c_global/cfenv: Likewise.
	* include/c_global/cwchar: Likewise.
	* include/c_global/cstdint: Likewise.
	* include/c_global/cwctype: Likewise.
	* include/tr1/shared_ptr.h: Likewise.
	* include/tr1/cinttypes: Likewise.
	* include/tr1/cstdio: Likewise.
	* include/tr1/cfenv: Likewise.
	* include/tr1/utility: Likewise.
	* include/tr1/cwchar: Likewise.
	* include/tr1/type_traits: Likewise.
	* include/tr1/memory: Likewise.
	* include/tr1/cstdint: Likewise.
	* include/tr1/regex: Likewise.
	* include/tr1/cwctype: Likewise.
	* include/tr1/cstdlib: Likewise.
	* include/tr1/cctype: Likewise.
	* include/tr1/cmath: Likewise.
	* include/tr1/complex: Likewise.
	* include/tr1/array: Likewise.
	* include/c_compatibility/fenv.h: Likewise.
	* include/c_compatibility/stdint.h: Likewise.
	* include/c_compatibility/inttypes.h: Likewise.
	* testsuite/tr1/2_general_utilities/shared_ptr/cons/43820.cc: Adjust
	dg-error line numbers.
	* testsuite/20_util/duration/requirements/typedefs_neg1.cc: Likewise.
	* testsuite/20_util/duration/requirements/typedefs_neg2.cc: Likewise.
	* testsuite/20_util/duration/requirements/typedefs_neg3.cc: Likewise.
	* testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Likewise.
	* testsuite/20_util/make_unsigned/requirements/
	typedefs_neg.cc: Likewise.
	* testsuite/20_util/declval/requirements/1_neg.cc: Likewise.
	* testsuite/20_util/shared_ptr/cons/43820.cc: Likewise.
	* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Likewise.

From-SVN: r166211
2010-11-02 18:51:23 +00:00
Benjamin Kosnik 94a86be0dd libstdc++: N3126 draft support.
* include/std/chrono: Extend constexpr application.
	* testsuite/util/testsuite_common_types.h
	(constexpr_default_constructible, constexpr_single_value_constructible)
	: Add comments about implied constraints.
	* testsuite/20_util/duration/cons/constexpr.cc: Activate all tests.
	* testsuite/20_util/time_point/cons/constexpr.cc: Same.
	* testsuite/20_util/time_point/requirements/constexpr_functions.cc:
	Same.
	* testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Adjust line
	numbers.
	* testsuite/20_util/time_point_cast/constexpr.cc: New.

	* include/std/bitset: Use __SIZEOF_* macros to re-create original
	logic instead of slipshod application of
	std::numeric_limits<T>::max() macros.
	* testsuite/util/testsuite_common_types.h
	(constexpr_default_constructible): Modify.

	* include/std/chrono: Tested constexpr.
	* testsuite/20_util/duration_cast/constexpr.cc: New.
	* testsuite/20_util/time_point/cons/constexpr.cc: New.

	* testsuite/20_util/duration/cons/constexpr.cc: Add single_value tests.
	* testsuite/20_util/duration/requirements/typedefs_neg1.cc: Adjust
	line numbers.
	* testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same.
	* testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same.
	* testsuite/20_util/time_point/cons/constexpr.cc: Add single_value
	tests.
	* testsuite/20_util/time_point/requirements/constexpr_functions.cc: Add.

	* testsuite/util/testsuite_common_types.h: Adjust init.

	* include/std/chrono (duration): Remove defaulted constructor,
	replace with mem-init list.
	* testsuite/20_util/duration/cons/constexpr.cc: Add single value.
	* testsuite/20_util/duration/requirements/constexpr_functions.cc:
	Add non-static member functions.

	* testsuite/20_util/default_delete/cons/constexpr.cc: New, xfail.
	* testsuite/20_util/enable_shared_from_this/cons/constexpr.cc: Same.
	* testsuite/20_util/shared_ptr/cons/constexpr.cc: Same.
	* testsuite/20_util/time_point/requirements/constexpr_functions.cc:
	Same.
	* testsuite/20_util/unique_ptr/cons/constexpr.cc: Same.
	* testsuite/20_util/weak_ptr/cons/constexpr.cc: Same.

	* include/std/bitset: Add constexpr as per N3126 draft.
	* testsuite/23_containers/bitset/cons/constexpr.cc: New.
	* testsuite/23_containers/bitset/requirements/constexpr_functions.cc:
	New.

	* testsuite/util/testsuite_common_types.h: Reset condition.

	* include/bits/random.h: Remove misleading comments.
	* include/bits/regex.h: Add constexpr.
	* testsuite/28_regex/05_constants/syntax_option_type.cc: Add tests.
	* testsuite/28_regex/08_basic_regex/requirements/constexpr_data.cc: New.

	PR libstdc++/46134
	* include/std/chrono: Use default constructor.
	* testsuite/util/testsuite_common_types.h
	(constexpr_default_constructible): Adjust condition.

	PR libstdc++/46133
	* include/std/complex: Adjust complex specialization default
	constructors for constexpr.
	* testsuite/26_numerics/complex/cons/constexpr.cc: Enable tests.

	* include/bits/random.h: Adjust for constexpr as per N3126 draft.
	* testsuite/26_numerics/random/discard_block_engine/requirements/
	constexpr_data.cc: New.
	* testsuite/26_numerics/random/discard_block_engine/requirements/
	constexpr_functions.cc: New.
	* testsuite/26_numerics/random/independent_bits_engine/requirements/
	constexpr_functions.cc: New.
	* testsuite/26_numerics/random/linear_congruential_engine/requirements/
	constexpr_data.cc: New.
	* testsuite/26_numerics/random/linear_congruential_engine/requirements/
	constexpr_functions.cc: New.
	* testsuite/26_numerics/random/mersenne_twister_engine/requirements/
	constexpr_data.cc: New.
	* testsuite/26_numerics/random/mersenne_twister_engine/requirements/
	constexpr_functions.cc: New.
	* testsuite/26_numerics/random/shuffle_order_engine/requirements/
	constexpr_data.cc: New.
	* testsuite/26_numerics/random/shuffle_order_engine/requirements/
	constexpr_functions.cc: New.
	* testsuite/26_numerics/random/subtract_with_carry_engine/requirements/
	constexpr_data.cc: New.
	* testsuite/26_numerics/random/subtract_with_carry_engine/requirements/
	constexpr_functions.cc: New.

	* include/bits/stream_iterator.h: Add constexpr as per N3126 draft.
	* include/bits/streambuf_iterator.h: Same.
	* include/std/complex: Same.
	* testsuite/24_iterators/istream_iterator/cons/constexpr.cc: New.
	* testsuite/24_iterators/istreambuf_iterator/cons/constexpr.cc: New.
	* testsuite/26_numerics/complex/cons/constexpr.cc: New.
	* testsuite/26_numerics/complex/requirements/constexpr_functions.cc:
	New.

	* include/bits/char_traits.h: Add constexpr as per N3126 draft.
	* testsuite/21_strings/char_traits/requirements/constexpr_functions.cc:
	New.

	* include/tr1_impl/array: Add constexpr as per N3126 draft.
	* testsuite/23_containers/array/requirements/
	constexpr_functions.cc: New.

	* include/bits/shared_ptr.h: Revert changes.
	* include/bits/unique_ptr.h: Same.

	* include/std/chrono: Adjust.
	* include/tr1_impl/type_traits: Same.

	* testsuite/util/testsuite_common_types.h: Add test functors.
	* testsuite/20_util/duration/cons/constexpr.cc: New.
	* testsuite/20_util/duration/requirements/constexpr_functions.cc: Same.
	* testsuite/20_util/pair/cons/constexpr.cc: Same.
	* testsuite/20_util/ratio/requirements/constexpr_data.cc: Same.
	* testsuite/27_io/ios_base/types/fmtflags/constexpr_operators.cc: Same.
	* testsuite/27_io/ios_base/types/iostate/constexpr_operators.cc: Same.
	* testsuite/27_io/ios_base/types/openmode/constexpr_operators.cc: Same.
	* testsuite/30_threads/call_once/constexpr.cc: Same.
	* testsuite/30_threads/mutex/cons/constexpr.cc: Same.
	* testsuite/30_threads/once_flag/cons/constexpr.cc: Same.
	* testsuite/tr1/4_metaprogramming/integral_constant/requirements/
	constexpr_data.cc: Same.

	* testsuite/29_atomics/atomic/cons/assign_neg.cc: Adjust line numbers.
	* testsuite/29_atomics/atomic/cons/copy_neg.cc: Same.
	* testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Same.
	* testsuite/29_atomics/atomic_integral/cons/copy_neg.cc: Same.
	* testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc: Same.

	* include/bits/allocator.h: Add constexpr as per N3126 draft.
	* include/bits/ios_base.h: Same.
	* include/bits/shared_ptr.h: Same.
	* include/bits/unique_ptr.h: Same.
	* include/bits/stl_iterator.h: Same.
	* include/bits/stl_pair.h: Same.
	* include/std/tuple: Same.
	* include/tr1_impl/type_traits: Same.
	* include/std/chrono: Same.
	* include/std/ratio: Same.
	* include/std/mutex: Same.
	* src/mutex.cc: Same.
	* testsuite/20_util/duration/requirements/typedefs_neg1.cc: Adjust.
	* testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same.
	* testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same.
	* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same.
	* testsuite/27_io/ios_base/cons/assign_neg.cc: Same.
	* testsuite/27_io/ios_base/cons/copy_neg.cc: Same.

	* doc/doxygen/user.cfg.in: Replace _GLIBCXX_USE_CONSTEXPR,
	_GLIBCXX_CONSTEXPR for doxygen generation.

	* src/limits.cc: Undef.
	* testsuite/29_atomics/atomic/cons/constexpr.cc: Adjust.
	* testsuite/29_atomics/atomic_address/cons/constexpr.cc: Same.
	* testsuite/29_atomics/atomic_integral/cons/constexpr.cc: Same.
	* testsuite/29_atomics/atomic_integral/operators/bitwise_neg.c: Same.
	* testsuite/18_support/numeric_limits/constexpr.cc: To...
	* testsuite/18_support/numeric_limits/requirements/
	constexpr_data.cc, constexpr_functions.cc: ...this

	* testsuite/util/testsuite_common_types.h
	(constexpr_single_value_constructible): Add.
	* testsuite/29_atomics/atomic/cons/constexpr.cc: Adjust name.
	* testsuite/29_atomics/atomic_integral/cons/constexpr.cc: Same.
	* testsuite/29_atomics/atomic_address/cons/constexpr.cc: New.
	* testsuite/18_support/numeric_limits/constexpr.cc: New.

	* testsuite/29_atomics/atomic/cons/assign_neg.cc: Adjust line numbers.
	* testsuite/29_atomics/atomic/cons/constexpr.cc: Same.
	* testsuite/29_atomics/atomic/cons/copy_neg.cc: Same.
	* testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Same.
	* testsuite/29_atomics/atomic_integral/cons/constexpr.cc: Same.
	* testsuite/29_atomics/atomic_integral/cons/copy_neg.cc: Same.
	* testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc: Same.
	* testsuite/29_atomics/atomic_integral/operators/decrement_neg.cc: Same.
	* testsuite/29_atomics/atomic_integral/operators/increment_neg.cc: Same.

	* include/bits/c++config (_GLIBCXX_CONSTEXPR): Add.
	(_GLIBCXX_USE_CONSTEXPR): Add.
	* include/std/limits: Use it.
	* src/limits.cc: Adjust.
	* testsuite/ext/profile/mutex_extensions.cc: Change line number.

	* include/bits/atomic_0.h: Rework for N3126 draft, add constexpr.
	* include/bits/atomic_2.h: Same.
	* include/bits/atomic_base.h: Same.
	* include/std/atomic: Same.
	* src/atomic.cc: Same.
	* include/bits/atomicfwd_c.h: Remove.
	* include/bits/atomicfwd_cxx.h: Remove.
	* include/c_compatibility/stdatomic.h: Remove.
	* include/Makefile.am: Remove atomicfwd_c.h, atomicfwd_cxx.h,
	stdatomic.h.
	* include/Makefile.in: Regenerate.
	* doc/xml/manual/using.xml: Update list of header files for changes.
	* testsuite/util/testsuite_common_types.h
	(constexpr_constructible): Add.
	* testsuite/29_atomics/atomic/cons/constexpr.cc: New.
	* testsuite/29_atomics/atomic_integral/cons/constexpr.cc: New.
	* testsuite/17_intro/headers/c++200x/stdc++.cc: Modify.
	* testsuite/29_atomics/atomic/cons/assign_neg.cc: Same.
	* testsuite/29_atomics/atomic_address/cons/assign_neg.cc: Same.
	* testsuite/29_atomics/atomic_flag/cons/1.cc: Same.
	* testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Same.
	* testsuite/29_atomics/headers/atomic/macros.cc: Same.
	* testsuite/29_atomics/headers/atomic/types_std_c++0x.cc: Same.
	* testsuite/29_atomics/headers/atomic/types_std_c++0x_neg.cc: Same.
	* testsuite/29_atomics/atomic_flag/test_and_set/implicit.c: Remove.
	* testsuite/29_atomics/atomic_flag/test_and_set/explicit.c: Same.
	* testsuite/29_atomics/atomic_flag/clear/1.c: Same.
	* testsuite/29_atomics/headers/stdatomic.h/debug_mode.c: Same.
	* testsuite/29_atomics/headers/stdatomic.h/functions.c: Same.
	* testsuite/29_atomics/headers/stdatomic.h/macros.c: Same.
	* testsuite/29_atomics/headers/stdatomic.h/types.c: Same.

	* testsuite/util/testsuite_abi.cc: Add GLIBCXX_3.4.16.

From-SVN: r166171
2010-11-01 22:35:28 -04:00
Paolo Carlini 0fd76d8e4c future (_Result_alloc): Derive from _Alloc, exploit the Empty Base Optimization.
2010-10-08  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/std/future (_Result_alloc): Derive from _Alloc,
	exploit the Empty Base Optimization.

From-SVN: r165194
2010-10-08 20:30:44 +00:00