Commit Graph

804 Commits

Author SHA1 Message Date
Jonathan Wakely
21e2806a8f re PR libstdc++/61269 (<type_traits> includes <cstdint> inside std namespace)
PR libstdc++/61269
	* include/std/type_traits: Move include outside namespace std.
	* testsuite/20_util/declval/requirements/1_neg.cc: Adjust dg-error.
	* testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Likewise.
	* testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc:
	Likewise.

From-SVN: r210715
2014-05-21 16:09:37 +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
cd1464dbc6 parse_numbers.h (__parse_int::_Number_help): Check for overflow.
* include/bits/parse_numbers.h (__parse_int::_Number_help): Check for
	overflow.
	* include/std/chrono (chrono_literals::__select_type::_Select_type):
	Remove.
	(chrono_literals::_Checked_integral_constant): Define.
	Simplify UDL operator templates and check for overflow.
	* testsuite/20_util/duration/literals/range.cc: New.

From-SVN: r210513
2014-05-16 12:08:49 +01:00
Jonathan Wakely
c0eef1c8f2 re PR libstdc++/60326 (Incorrect type from std::make_unsigned<wchar_t>)
PR libstdc++/60326
	* include/std/type_traits (__make_unsigned, __make_signed): Define
	specializations for wchar_t, char16_t and char32_t.
	* testsuite/20_util/make_signed/requirements/typedefs-4.cc: New.
	* testsuite/20_util/make_unsigned/requirements/typedefs-1.cc: Correct
	test for make_unsigned<volatile wchar_t>.
	* testsuite/20_util/make_unsigned/requirements/typedefs-2.cc:
	Likewise.
	* testsuite/20_util/declval/requirements/1_neg.cc: Adjust dg-error
	line number.
	* testsuite/20_util/make_signed/requirements/typedefs_neg.cc:
	Likewise.
	* testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc:
	Likewise.

From-SVN: r210473
2014-05-15 13:31:05 +01:00
Jonathan Wakely
3a004764ec tuple (tuple_size<cv _Tp>): Implement LWG 2313.
* include/std/tuple (tuple_size<cv _Tp>): Implement LWG 2313.
	* include/std/array (tuple_size, tuple_element): Add Doxygen comments.
	* include/std/utility (tuple_size, tuple_element): Likewise.
	* testsuite/23_containers/array/tuple_interface/tuple_element_neg.cc:
	Adjust dg-error line number.

From-SVN: r210470
2014-05-15 11:35:29 +01:00
Jonathan Wakely
af222e7486 tuple (__add_c_ref, [...]): Remove.
* include/std/tuple (__add_c_ref, __add_ref, __add_r_ref): Remove.
	(__tuple_element_t): Define.
	(tuple_element): Use __tuple_element_t.
	(__cv_tuple_size): Define.
	(tuple_size<cv _Tp>): Use __cv_tuple_size.
	(get, __get_helper, __get_helper2): Remove uses of __add_ref etc.
	(get<_Tp>(tuple<_Types...>&&)): Use forward instead of move.
	(__tuple_compare): Remove size check, re-order parameters.
	(operator==, operator<): Use static_assert to check requirements.
	* include/std/functional (__volget): use __tuple_element_t.
	* testsuite/20_util/tuple/element_access/get_by_type.cc: Test rvalues.
	* testsuite/20_util/uses_allocator/cons_neg.cc: Adjust dg-error.

From-SVN: r210447
2014-05-14 23:16:35 +01:00
Jonathan Wakely
b82f988e8d re PR libstdc++/60497 (unique_ptr<T> tries to complete its type T even though it's not required to be a complete type)
PR libstdc++/60497
	* include/debug/array (get): Qualify call to other get overload.
	* include/profile/array (get): Likewise.
	* include/std/array (get): Likewise.
	* include/std/functional (_Mu, _Bind, _Bind_result): Qualify std::get.
	* include/std/mutex (unique_lock, call_once): Use __addressof.
	(__unlock_impl): Remove unused template.
	(__try_to_lock): Declare inline.
	(__try_lock_impl::__do_try_lock): Qualify function calls.
	(lock): Avoid narrowing conversion.
	* testsuite/20_util/bind/60497.cc: New.
	* testsuite/23_containers/array/element_access/60497.cc: New.
	* testsuite/30_threads/call_once/60497.cc: New.
	* testsuite/30_threads/unique_lock/cons/60497.cc: New.

From-SVN: r210388
2014-05-13 18:22:08 +01:00
Jonathan Wakely
75e75a087d re PR libstdc++/60497 (unique_ptr<T> tries to complete its type T even though it's not required to be a complete type)
PR libstdc++/60497
	* include/std/tuple (get, __tuple_compare): Qualify more calls to
	prevent ADL. Cast comparison results to bool.
	* testsuite/20_util/tuple/60497.cc: Test accessing rvalues.
	* testsuite/20_util/tuple/comparison_operators/overloaded.cc: New.

From-SVN: r210366
2014-05-13 12:18:01 +01:00
Jonathan Wakely
07e4f10aa6 iostream: Fix URL in comment.
* include/std/iostream: Fix URL in comment.
	* src/c++98/ios_init.cc: Fix path in comment.

From-SVN: r210232
2014-05-08 20:01:51 +01:00
Jonathan Wakely
2735097a55 re PR libstdc++/13860 (Poor error messages on invalid template parameters for basic_filebuf)
PR libstdc++/13860
	* include/std/fstream (basic_filebuf): Enforce requirements on traits.

From-SVN: r210231
2014-05-08 19:30:14 +01:00
Jonathan Wakely
f0fd118f53 re PR libstdc++/57394 ([C++11] basic_streambuf incorrect copy constructor / copy assignment access specifier)
PR libstdc++/57394
	* include/bits/ios_base.h (ios_base(const ios_base&)): Define as
	deleted for C++11.
	(operator=(const ios_base&)): Likewise.
	* include/std/streambuf: Remove trailing whitespace.
	(basic_streambuf(const basic_streambuf&)): Fix initializer for
	_M_out_end. Define as defaulted for C++11.
	(operator=(const basic_streambuf&)): Define as defaulted for C++11.
	(swap(basic_streambuf&)): Define for C++11.
	* testsuite/27_io/basic_streambuf/cons/57394.cc: New.

From-SVN: r210228
2014-05-08 18:17:06 +01:00
Jonathan Wakely
6e2d247b1e * include/std/functional (__is_location_invariant): Use __or_ helper.
From-SVN: r209445
2014-04-16 18:46:13 +01:00
Jonathan Wakely
227df36e33 * include/std/atomic: Uglify parameter names.
From-SVN: r209429
2014-04-15 19:28:57 +01:00
Jonathan Wakely
4803acceb2 re PR libstdc++/60594 (std::function of a type with a declared (but not defined) return type fails to compile)
PR libstdc++/60594
	* include/std/functional (function::_Callable): Exclude own type
	from the callable checks.
	* testsuite/20_util/function/60594.cc: New.

From-SVN: r209422
2014-04-15 16:25:52 +01:00
Jonathan Wakely
9ffc6d0bc2 re PR libstdc++/60695 (std::atomic<X> doesn't work when X is of zero size)
PR libstdc++/60695
	* include/std/atomic (atomic<_Tp>): Add static assertion.
	* testsuite/29_atomics/atomic/60695.cc: New.

From-SVN: r209418
2014-04-15 14:48:07 +01:00
Jonathan Wakely
025eac9b9e N3887 Consistent Metafunction Aliases
* include/std/tuple (tuple_element_t): Define.
	* testsuite/20_util/tuple/tuple_element.cc: Change to compile-only
	test.
	* testsuite/20_util/tuple/tuple_element_t.cc: New.

From-SVN: r209395
2014-04-15 00:17:52 +01:00
Jonathan Wakely
39e6a690ec re PR libstdc++/60497 (unique_ptr<T> tries to complete its type T even though it's not required to be a complete type)
PR libstdc++/60497
	* include/std/tuple (get): Qualify calls to prevent ADL.
	* testsuite/20_util/tuple/60497.cc: New.

From-SVN: r209381
2014-04-14 16:32:58 +01:00
Marc Glisse
742f66e736 complex (__complex_exp, pow): Specify the template parameter in calls to std::polar, for expression templates.
2014-04-11  Marc Glisse  <marc.glisse@inria.fr>

	* include/std/complex (__complex_exp, pow): Specify the template
	parameter in calls to std::polar, for expression templates.

From-SVN: r209321
2014-04-11 18:57:59 +00:00
Lars Gullik Bjønnes
71bdda5625 re PR libstdc++/60270 ([C++1y] std::quoted is too eager to clear the string)
2014-03-31  Lars Gullik Bjønnes  <larsbj@gullik.org>
	    Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/60270
	* include/std/iomanip (_Quoted_string operator>>): Do not clear
	string if input is not quoted.
	* testsuite/27_io/manipulators/standard/char/60270.cc: New.

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

From-SVN: r208966
2014-03-31 19:46:23 +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
Ed Smith-Rowland
4bbfc5fa4d Rename shared_mutex to shared_timed_mutex per C++14 acceptance of N3891.
2014-02-20  Ed Smith-Rowland  <3dw4rd@verizon.net>

	Rename shared_mutex to shared_timed_mutex per C++14 acceptance of N3891.
	* include/std/shared_mutex: Rename shared_mutex to shared_timed_mutex.
	* testsuite/30_threads/shared_lock/locking/2.cc: Ditto.
	* testsuite/30_threads/shared_lock/locking/4.cc: Ditto.
	* testsuite/30_threads/shared_lock/locking/1.cc: Ditto.
	* testsuite/30_threads/shared_lock/locking/3.cc: Ditto.
	* testsuite/30_threads/shared_lock/requirements/
	explicit_instantiation.cc: Ditto.
	* testsuite/30_threads/shared_lock/requirements/typedefs.cc: Ditto.
	* testsuite/30_threads/shared_lock/cons/2.cc: Ditto.
	* testsuite/30_threads/shared_lock/cons/4.cc: Ditto.
	* testsuite/30_threads/shared_lock/cons/1.cc: Ditto.
	* testsuite/30_threads/shared_lock/cons/6.cc: Ditto.
	* testsuite/30_threads/shared_lock/cons/3.cc: Ditto.
	* testsuite/30_threads/shared_lock/cons/5.cc: Ditto.
	* testsuite/30_threads/shared_lock/modifiers/2.cc: Ditto.
	* testsuite/30_threads/shared_lock/modifiers/1.cc: Ditto.
	* testsuite/30_threads/shared_mutex/requirements/
	standard_layout.cc: Ditto.
	* testsuite/30_threads/shared_mutex/cons/copy_neg.cc: Ditto.
	* testsuite/30_threads/shared_mutex/cons/1.cc: Ditto.
	* testsuite/30_threads/shared_mutex/cons/assign_neg.cc: Ditto.
	* testsuite/30_threads/shared_mutex/try_lock/2.cc: Ditto.
	* testsuite/30_threads/shared_mutex/try_lock/1.cc: Ditto.

From-SVN: r207964
2014-02-20 16:06:40 +00:00
Tim Shen
ddf41e9db6 regex_automaton.tcc (_StateSeq<>::_M_clone()): Do not use std::map.
2014-01-17  Tim Shen  <timshen91@gmail.com>

	* include/bits/regex_automaton.tcc (_StateSeq<>::_M_clone()): Do not
	use std::map.
	* include/bits/regex_automaton.h: Do not use std::set.
	* include/bits/regex_compiler.h (_BracketMatcher<>::_M_add_char(),
	_BracketMatcher<>::_M_add_collating_element(),
	_BracketMatcher<>::_M_add_equivalence_class(),
	_BracketMatcher<>::_M_make_range()): Likewise.
	* include/bits/regex_compiler.tcc (_BracketMatcher<>::_M_apply()):
	Likewise.
	* include/bits/regex_executor.h: Do not use std::queue.
	* include/bits/regex_executor.tcc (_Executor<>::_M_main(),
	_Executor<>::_M_dfs()): Likewise.
	* include/std/regex: Remove <map>, <set> and <queue>.

2014-01-17  Tim Shen  <timshen91@gmail.com>

	* include/bits/regex.h (__compile_nfa<>(), basic_regex<>::basic_regex(),
	basic_regex<>::assign()): Change __compile_nfa to accept
	const _CharT* only.
	* include/bits/regex_compiler.h: Change _Compiler's template
	argument from <_FwdIter, _TraitsT> to <_TraitsT>.
	* include/bits/regex_compiler.tcc: Likewise.

2014-01-17  Tim Shen  <timshen91@gmail.com>

	* include/bits/regex_compiler.h: Change _ScannerT into char-type
	templated.
	* include/bits/regex_scanner.h (_Scanner<>::_Scanner()): Separate
	_ScannerBase from _Scanner; Change _Scanner's template argument from
	_FwdIter to _CharT. Avoid use of std::map and std::set by using arrays
	instead.
	* include/bits/regex_scanner.tcc (_Scanner<>::_Scanner(),
	_Scanner<>::_M_scan_normal(), _Scanner<>::_M_eat_escape_ecma(),
	_Scanner<>::_M_eat_escape_posix(), _Scanner<>::_M_eat_escape_awk()):
	Likewise.
	* include/std/regex: Add <cstring> for using strchr.

2014-01-17  Tim Shen  <timshen91@gmail.com>

	* bits/regex_automaton.tcc: Indentation fix.
	* bits/regex_compiler.h (__compile_nfa<>(), _Compiler<>,
	_RegexTranslator<> _AnyMatcher<>, _CharMatcher<>,
	_BracketMatcher<>): Add bool option template parameters and
	specializations to make matching more efficient and space saving.
	* bits/regex_compiler.tcc: Likewise.

From-SVN: r206690
2014-01-16 23:35:21 +00:00
Tim Shen
f43cc2a68d regex_compiler.h (_AnyMatcher<>::_AnyMatcher(), [...]): Fix _AnyMatcher behavior of POSIX style and move _M_flags to template parameter...
2014-01-07  Tim Shen  <timshen91@gmail.com>

	* include/bits/regex_compiler.h (_AnyMatcher<>::_AnyMatcher(),
	_AnyMatcher<>::operator(), _AnyMatcher<>::_M_apply(),
	_CharMatcher<>::_CharMatcher(), _CharMatcher<>::_M_translate(),
	_BracketMatcher<>::_BracketMatcher(), _BracketMatcher<>::operator(),
	_BracketMatcher<>::_M_add_char(),
	_BracketMatcher<>::_M_add_collating_element(),
	_BracketMatcher<>::_M_add_equivalence_class(),
	_BracketMatcher<>::_M_add_character_class(),
	_BracketMatcher<>::_M_make_range(), _BracketMatcher<>::_M_ready(),
	_BracketMatcher<>::_M_apply(), _BracketMatcher<>::_M_make_cache()):
	Fix _AnyMatcher behavior of POSIX style and move _M_flags
	to template parameter; Add cache for _BracketMatcher. Adjust
	declarations from here...
	* include/bits/regex.h (basic_regex<>::imbue()): ...to here. Also,
	imbuing a regex will trigger a recompilation to rebuild the cache.
	* include/bits/regex_compiler.tcc (_Compiler<>::_M_atom(),
	_Compiler<>::_M_bracket_expression()): Adjust matchers' caller for
	different template bool parameters.
	* include/bits/regex_executor.h: Remove unnecessary declarations.
	* include/std/regex: Adjust including orders.
	* testsuite/28_regex/traits/char/user_defined.cc: New.
	* testsuite/28_regex/traits/wchar_t/user_defined.cc: New.

From-SVN: r206400
2014-01-07 19:17:50 +00:00
Richard Sandiford
aa118a03c4 Update copyright years in libstdc++-v3/
From-SVN: r206301
2014-01-02 22:30:10 +00:00
Paolo Carlini
a0d026d943 value.cc: Add test.
2013-12-10  Paolo Carlini  <paolo.carlini@oracle.com>

	* testsuite/20_util/is_base_of/value.cc: Add test.

	* include/std/fstream: Tiny formatting tweak.

From-SVN: r205851
2013-12-10 09:48:50 +00:00
Paolo Carlini
03fd2f6092 re PR libstdc++/59427 (Opening with ios::in | ios::app does not allow appending)
2013-12-09  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/59427
	* include/bits/fstream.tcc (basic_filebuf<>::overflow,
	basic_filebuf<>::xsputn): Per lwg/596, ios_base::app implies
	ios_base:out.
	* include/std/fstream (basic_filebuf<>::_M_set_buffer): Likewise.
	* testsuite/27_io/basic_filebuf/sputc/char/59427.cc: New.
	* testsuite/27_io/basic_filebuf/sputn/char/59427.cc: Likewise.

From-SVN: r205837
2013-12-09 23:02:18 +00:00
Jonathan Wakely
a566cb5e81 fstream (basic_filebuf::open): Use preformatted text for table in Doxygen comment.
* include/std/fstream (basic_filebuf::open): Use preformatted text
	for table in Doxygen comment.

From-SVN: r205631
2013-12-03 12:58:15 +00:00
Jonathan Wakely
237c8b9d2f re PR libstdc++/59247 (Bootstrap fails due to errors in libstdc++ sources with `--enable-symvers=gnu-versioned-namespace')
PR libstdc++/59247
	* include/bits/c++config (_GLIBCXX_INLINE_VERSION): Declare namespace
	std::experimental::__7 as inline.
	* include/bits/regex.h (_GLIBCXX_BEGIN_NAMESPACE_VERSION): Do not
	enclose namespace __detail.
	* include/bits/regex.tcc (_GLIBCXX_BEGIN_NAMESPACE_VERSION): Likewise.
	* include/std/iomanip (_GLIBCXX_BEGIN_NAMESPACE_VERSION): Likewise.
	* include/ext/pb_ds/tag_and_trait.hpp (detail): Fix comment.
	* testsuite/ext/profile/mutex_extensions_neg.cc: Adjust line number.

From-SVN: r205277
2013-11-22 16:59:25 +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
6162239973 re PR libstdc++/54562 (mutex and condition variable timers)
PR libstdc++/54562
	* include/std/mutex (__timed_mutex_impl::__clock_t): Use
	high_resolution_clock for absolute timeouts, because
	pthread_mutex_timedlock uses CLOCK_REALTIME not CLOCK_MONOTONIC.
	(__timed_mutex_impl::_M_try_lock_for): Use steady_clock for relative
	timeouts as per [thread.req.timing].
	(__timed_mutex_impl::_M_try_lock_until<Clock,Duration>): Convert to
	__clock_t time point instead of using _M_try_lock_for.

From-SVN: r204672
2013-11-11 13:33:48 +00:00
Jonathan Wakely
4457e88ce1 N3655 C++1y TransformationTraits Redux
N3655 C++1y TransformationTraits Redux
	* include/std/type_traits (remove_const_t, remove_volatile_t,
	remove_cv_t, add_const_t, add_volatile_t, add_cv_t, remove_reference_t,
	add_lvalue_reference_t, add_rvalue_reference_t, make_signed_t,
	make_unsigned_t, remove_extent_t, remove_all_extents_t,
	remove_pointer_t, add_pointer_t, aligned_storage_t, decay_t,
	enable_if_t, conditional_t, common_type_t, underlying_type_t,
	result_of_t): Define.
	* doc/xml/manual/status_cxx2014.xml: Update.
	* testsuite/20_util/add_lvalue_reference/requirements/typedefs-3.cc:
	New.
	* testsuite/20_util/add_rvalue_reference/requirements/typedefs-3.cc:
	New.
	* testsuite/20_util/common_type/requirements/typedefs-3.cc: New.
	* testsuite/20_util/conditional/requirements/typedefs-2.cc: New.
	* testsuite/20_util/decay/requirements/typedefs-2.cc: New.
	* testsuite/20_util/enable_if/requirements/typedefs-2.cc: New.
	* testsuite/20_util/make_signed/requirements/typedefs-3.cc: New.
	* testsuite/20_util/make_unsigned/requirements/typedefs-3.cc: New.
	* testsuite/20_util/remove_reference/requirements/typedefs.cc: New.
	* testsuite/20_util/result_of/requirements/typedefs.cc: New.
	* testsuite/20_util/underlying_type/requirements/typedefs-3.cc: New.
	* testsuite/20_util/common_type/requirements/typedefs-2.cc: Change to
	compile-only test.
	* testsuite/20_util/decay/requirements/typedefs.cc: Likewise.
	* testsuite/20_util/make_signed/requirements/typedefs-1.cc: Likewise.
	* testsuite/20_util/declval/requirements/1_neg.cc: Adjust dg-error
	line number.
	* testsuite/20_util/make_signed/requirements/typedefs_neg.cc:
	Likewise.
	* testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc:
	Likewise.

From-SVN: r204426
2013-11-05 22:57:36 +00:00
Jonathan Wakely
1b1bdc03f8 tuple (_Index_tuple, [...]): Move to <utility>.
* include/std/tuple (_Index_tuple, _Build_index_tuple): Move to
	<utility>.
	* include/std/utility (integer_sequence, make_integer_sequence,
	index_sequence, make_index_sequence, index_sequence_for): Define.
	* doc/xml/manual/status_cxx2014.xml: Update.
	* testsuite/20_util/integer_sequence/intseq.cc: New.
	* testsuite/20_util/integer_sequence/requirements/typedefs.cc: New.

From-SVN: r204275
2013-10-31 19:23:54 +00:00
Paolo Carlini
66caf47a50 re PR libstdc++/58850 (Conversion error in chrono)
2013-10-23  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/58850
	* include/std/chrono (minutes, hours): Change typedefs to uniformly
	use int64_t.
	* testsuite/20_util/duration/arithmetic/58850.cc: New.

From-SVN: r203978
2013-10-23 15:31:26 +00:00
Edward Smith-Rowland
e9a6449215 basic_string.h (operator""s): Remove space between quotes and literal identifier.
2013-10-22  Edward Smith-Rowland  <3dw4rd@verizon.net>

	* include/bits/basic_string.h (operator""s): Remove space between quotes
	and literal identifier.
	* include/std/chrono (operator""h, operator""min, operator""s,
	operator""ms, operator""us, operator""ns): Ditto.

From-SVN: r203941
2013-10-23 00:12:36 +00:00
Ed Smith-Rowland
ae5543e662 Implement N3779 - User-defined Literals for std::complex, part 2 of UDL for Standard Library Types
2013-09-27  Ed Smith-Rowland  <3dw4rd@verizon.net>

	Implement N3779 - User-defined Literals for std::complex,
	part 2 of UDL for Standard Library Types
	* include/std/complex: Add complex literal operators.
	* testsuite/26_numerics/complex/literals/types.cc: New.
	* testsuite/26_numerics/complex/literals/values.cc: New.

From-SVN: r203940
2013-10-23 00:09:19 +00:00
John Woolverton
d358f34868 re PR libstdc++/58604 (Text truncation in comments of /usr/include/c++/4.7/vector)
2013-10-03  John Woolverton  <jdwoolverton@gmail.com>

	PR libstdc++/58604
	* include/std/vector: Fix garbled line in HP Copyright.

From-SVN: r203187
2013-10-03 20:33:05 +00:00
Jonathan Wakely
44d209d7e2 re PR libstdc++/58569 (Compilation error when a class contains multiple std::function)
2013-10-02  Jonathan Wakely  <jwakely.gcc@gmail.com>
	    Daniel Krugler  <daniel.kruegler@gmail.com>

	PR libstdc++/58569
	* include/std/functional (function::_CheckResult): Move to namespace
	scope and rename to __check_func_return_type.
	* testsuite/20_util/function/58569.cc: New.

Co-Authored-By: Daniel Kruegler <daniel.kruegler@gmail.com>

From-SVN: r203132
2013-10-02 21:21:52 +01:00
Jonathan Wakely
d02dae41e3 re PR libstdc++/57465 (Failed postcondition for std::function constructed with null function pointer)
PR libstdc++/57465
	* include/std/functional
	(_Function_base::_Base_manager::_M_not_empty_function): Fix overload
	for pointers.
	* testsuite/20_util/function/cons/57465.cc: New.

From-SVN: r202974
2013-09-27 15:06:09 +01:00
Paul Pluzhnikov
9779c871af Print additional info when various out-of-range conditions are detected.
2013-09-21  Paul Pluzhnikov  <ppluzhnikov@google.com>

	* include/bits/functexcept.h (__throw_out_of_range_fmt): New.
	* src/c++11/functexcept.cc (__throw_out_of_range_fmt): New.
	* src/c++11/snprintf_lite.cc: New.
	* src/c++11/Makefile.am: Add snprintf_lite.cc.
	* src/c++11/Makefile.in: Regenerate.
	* config/abi/pre/gnu.ver: Add _ZSt24__throw_out_of_range_fmtPKcz.
	* include/std/array (at): Use __throw_out_of_range_fmt.
	* include/debug/array (at): Likewise.
	* include/profile/array (at): Likewise.
	* include/std/bitset (_M_check_initial_position, _M_check): New.
	(bitset::bitset): Use _M_check_initial_position.
	(set, reset, flip, test): Use _M_check.
	* include/ext/vstring.h (_M_check, at): Use __throw_out_of_range_fmt.
	* include/bits/stl_vector.h (_M_range_check): Likewise.
	* include/bits/stl_bvector.h (_M_range_check): Likewise.
	* include/bits/stl_deque.h (_M_range_check): Likewise.
	* include/bits/basic_string.h (_M_check, at): Likewise.
	* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Adjust.
	* 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/array/tuple_interface/tuple_element_neg.cc: Likewise.
	* testsuite/23_containers/array/tuple_interface/tuple_element_debug_neg.cc:
	Likewise.
	* testsuite/23_containers/array/tuple_interface/get_neg.cc: Likewise.
	* testsuite/23_containers/array/tuple_interface/get_debug_neg.cc: Likewise.
	* testsuite/util/exception/safety.h (generate): Use __throw_out_of_range_fmt.

From-SVN: r202818
2013-09-21 19:04:13 -07:00
Marc Glisse
b4efa80e56 re PR libstdc++/58338 (Add noexcept to functions with a narrow contract)
2013-09-18  Marc Glisse  <marc.glisse@inria.fr>

	PR libstdc++/58338
	* include/bits/stl_iterator.h (__normal_iterator) [__normal_iterator,
	_M_const_cast, operator*, operator->, operator++, operator--,
	operator[], operator+=, operator+, operator-=, operator-, base]:
	Mark as noexcept.
	(operator==(const __normal_iterator&, const __normal_iterator&),
	operator!=(const __normal_iterator&, const __normal_iterator&),
	operator<(const __normal_iterator&, const __normal_iterator&),
	operator>(const __normal_iterator&, const __normal_iterator&),
	operator<=(const __normal_iterator&, const __normal_iterator&),
	operator>=(const __normal_iterator&, const __normal_iterator&),
	operator-(const __normal_iterator&, const __normal_iterator&),
	operator+(difference_type, const __normal_iterator&)): Likewise.
	* include/bits/stl_list.h (list) [splice, _M_check_equal_allocators]:
	Likewise.
	(list::_M_check_equal_allocators): Abort instead of throwing.
	* include/debug/array (array) [operator[], front, back]: Mark as
	noexcept.
	* include/profile/array (array) [operator[], front, back]: Likewise.
	* include/std/array (array) [operator[], front, back]: Likewise.
	* include/debug/list (list::splice): Likewise.
	* include/profile/list (list::splice): Likewise.
	* testsuite/23_containers/list/operations/5.cc: Remove file.
	* testsuite/23_containers/list/operations/5.h: Likewise.

From-SVN: r202716
2013-09-18 18:31:01 +00:00
Tim Shen
33fbbb766c Makefile.am: Add regex_scanner.{h,tcc}.
2013-08-26  Tim Shen  <timshen91@gmail.com>

	* include/Makefile.am: Add regex_scanner.{h,tcc}.
	* include/Makefile.in: Regenerate.
	* include/bits/regex.h (match_search): Handle the `__first == __last`
	  situation correctly.
	* include/bits/regex_compiler.h: Move _Scanner...
	* include/bits/regex_scanner.h: ...to here. New.
	* include/bits/regex_compiler.tcc: Move _Scanner...
	* include/bits/regex_scanner.tcc: ...to here, too. New.
	* include/bits/regex_executor.tcc: Use value instead of reference for
	  submatch.
	* include/std/regex: Add regex_scanner.h
	* testsuite/28_regex/algorithms/regex_match/awk/cstring_01.cc: New.
	* testsuite/28_regex/algorithms/regex_match/basic/empty_range.cc: New.
	* testsuite/28_regex/algorithms/regex_match/ecma/cstring_hex.cc: New.
	* testsuite/28_regex/algorithms/regex_match/ecma/empty_range.cc: New.
	* testsuite/28_regex/algorithms/regex_search/ecma/string_01.cc: New.

From-SVN: r202015
2013-08-27 02:49:22 +00:00
Tim Shen
6cb784b639 Makefile.am: Adjust to new files.
2013-08-07  Tim Shen  <timshen91@gmail.com>

	* include/Makefile.am: Adjust to new files.
	* include/Makefile.in: Regenerate.
	* include/bits/regex.h: Adjust to new interfaces.
	* include/bits/regex_automaton.h: New.
	* include/bits/regex_automaton.tcc: New.
	* include/bits/regex_compiler.h: Adjust to new files.
	* include/bits/regex_compiler.tcc: New.
	* include/bits/regex_constants.h: Tail spaces.
	* include/bits/regex_error.h: Likewise.
	* include/bits/regex_executor.h: New.
	* include/bits/regex_executor.tcc: New.
	* include/std/regex: Adjust to new files.
	* testsuite/28_regex/algorithms/regex_match/extended/
	string_dispatch_01.cc: Adjust to new interfaces.

From-SVN: r201573
2013-08-07 16:27:36 +00:00
Tim Shen
95c7d82816 Thompson matcher refactored.
2013-07-31  Tim Shen  <timshen91@gmail.com>

	Thompson matcher refactored. Fix grouping problem.
	* include/bits/regex.h: Use a dispatcher _M_get_matcher().
	* include/bits/regex_compiler.h: Tweak for auto switching.
	* include/bits/regex_grep_matcher.h: Class structure.
	* include/bits/regex_grep_matcher.tcc: _BFSMatcher(Thompson
	matcher) refactoring.
	* include/bits/regex_nfa.h: Change _Results's interfaces.
	* include/std/regex: Includes <map> and <queue>.
	* testsuite/28_regex/algorithms/regex_match/extended/53622.cc:
	For both matchers.
	* testsuite/28_regex/algorithms/regex_match/extended/57173.cc:
	For both matchers.
	* testsuite/28_regex/algorithms/regex_match/extended/
	string_dispatch_01.cc: New.

From-SVN: r201391
2013-07-31 22:36:11 +00:00
Paolo Carlini
4333e4dcf7 re PR libstdc++/56627 (class hash instead of struct hash)
2013-07-31  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/56627
	* include/bits/stl_bvector.h: Use friend struct hash intead of
	friend class hash to work around useless warnings produced by
	some compilers.
	* include/std/bitset: Likewise.

From-SVN: r201377
2013-07-31 14:36:13 +00:00
Tim Shen
1151053225 Revert last commit.
From-SVN: r201360
2013-07-31 03:36:37 +00:00
Tim Shen
abf1719efe Thompson matcher refactored.
2013-07-31  Tim Shen  <timshen91@gmail.com>

	Thompson matcher refactored. Fix grouping problem.
	* include/bits/regex.h: Use a dispatcher _M_get_matcher().
	* include/bits/regex_compiler.h: Tweak for auto switching.
	* include/bits/regex_grep_matcher.h: Class structure.
	* include/bits/regex_grep_matcher.tcc: _BFSMatcher(Thompson
	matcher) refactoring.
	* include/bits/regex_nfa.h: Change _Results's interfaces.
	* include/std/regex: Includes <map> and <queue>.
	* testsuite/28_regex/algorithms/regex_match/extended/53622.cc:
	For both matchers.
	* testsuite/28_regex/algorithms/regex_match/extended/57173.cc:
	For both matchers.
	* testsuite/28_regex/algorithms/regex_match/extended/
	string_dispatch_01.cc: New.

From-SVN: r201358
2013-07-31 00:20:06 +00:00
Paolo Carlini
5034aa2102 2013-07-30 Paolo Carlini <paolo.carlini@oracle.com>
Revert last commit.

From-SVN: r201348
2013-07-30 18:13:15 +00:00
Tim Shen
a6dc77bc3d Thompson matcher refactored.
2013-07-30  Tim Shen  <timshen91@gmail.com>

	Thompson matcher refactored. Fix grouping problem.
	* include/bits/regex.h: Use a dispatcher _M_get_matcher().
	* include/bits/regex_compiler.h: Tweak for auto switching.
	* include/bits/regex_grep_matcher.h: Class structure.
	* include/bits/regex_grep_matcher.tcc: _BFSMatcher(Thompson
	matcher) refactoring.
	* include/bits/regex_nfa.h: Change _Results's interfaces.
	* include/std/regex: Includes <map> and <queue>.
	* testsuite/28_regex/algorithms/regex_match/extended/53622.cc:
	For both matchers.
	* testsuite/28_regex/algorithms/regex_match/extended/57173.cc:
	For both matchers.
	* testsuite/28_regex/algorithms/regex_match/extended/string_dispatch_01.cc:
	New.

From-SVN: r201334
2013-07-30 12:02:55 +00:00
Nathan Froyd
272827e446 atomic (compare_exchange_weak, [...]): Add call to __cmpexch_failure_order.
libstdc++-v3/
	* include/std/atomic (compare_exchange_weak, compare_exchange_strong):
	Add call to __cmpexch_failure_order.
	* testsuite/util/testsuite_common_types.h
	(compare_exchange_order_lowering): New generator.
	* testsuite/29_atomics/atomic/requirements/compare_exchange_lowering.cc:
	New test.

From-SVN: r201315
2013-07-29 17:13:05 +00:00
Paolo Carlini
4e30cb71f9 complex (pow(const complex<>&, int)): Enable in C++11 mode too.
2013-07-25  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/std/complex (pow(const complex<>&, int)): Enable in
	C++11 mode too.
	* testsuite/26_numerics/complex/dr844.cc: Adjust.
	* doc/xml/manual/intro.xml: Update.

From-SVN: r201253
2013-07-25 21:24:07 +00:00