Commit Graph

2864 Commits

Author SHA1 Message Date
Jonathan Wakely b1705a6388 optional: Use __and_<> and __not_<> in conditions.
2013-11-05  Jonathan Wakely  <jwakely.gcc@gmail.com>
	    Paolo Carlini  <paolo.carlini@oracle.com>

	* include/experimental/optional: Use __and_<> and __not_<> in
	conditions. Style fixes.
	(__constexpr_addressof, swap): Make inline.
	* testsuite/experimental/optional/cons/copy.cc: Adjust constants for
	32-bit targets.
	* testsuite/experimental/optional/cons/move.cc: Likewise.
	* testsuite/experimental/optional/cons/value.cc: Likewise.
	* testsuite/experimental/optional/constexpr/cons/value.cc: Likewise.

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

From-SVN: r204402
2013-11-05 15:24:08 +00:00
Michael Brune 2b5ab1e438 enable_special_members.h: New.
2013-10-31  Michael Brune  <lucdanton@free.fr>

	* include/bits/enable_special_members.h: New.
	* include/experimental/optional: New.
	* include/Makefile.am: Handle include/experimental.
	* include/Makefile.in: Regenerate.
	* testsuite/libstdc++-dg/conformance.exp: Run tests from
	testsuite/experimental sub-directory.
	* testsuite/experimental/optional/assignment/1.cc: New.
	* testsuite/experimental/optional/assignment/2.cc: New.
	* testsuite/experimental/optional/assignment/3.cc: New.
	* testsuite/experimental/optional/assignment/4.cc: New.
	* testsuite/experimental/optional/assignment/5.cc: New.
	* testsuite/experimental/optional/assignment/6.cc: New.
	* testsuite/experimental/optional/cons/copy.cc: New.
	* testsuite/experimental/optional/cons/default.cc: New.
	* testsuite/experimental/optional/cons/move.cc: New.
	* testsuite/experimental/optional/cons/value.cc: New.
	* testsuite/experimental/optional/constexpr/cons/default.cc: New.
	* testsuite/experimental/optional/constexpr/cons/value.cc: New.
	* testsuite/experimental/optional/constexpr/in_place.cc: New.
	* testsuite/experimental/optional/constexpr/make_optional.cc: New.
	* testsuite/experimental/optional/constexpr/nullopt.cc: New.
	* testsuite/experimental/optional/constexpr/observers/1.cc: New.
	* testsuite/experimental/optional/constexpr/observers/2.cc: New.
	* testsuite/experimental/optional/constexpr/observers/3.cc: New.
	* testsuite/experimental/optional/constexpr/observers/4.cc: New.
	* testsuite/experimental/optional/constexpr/observers/5.cc: New.
	* testsuite/experimental/optional/constexpr/relops/1.cc: New.
	* testsuite/experimental/optional/constexpr/relops/2.cc: New.
	* testsuite/experimental/optional/constexpr/relops/3.cc: New.
	* testsuite/experimental/optional/constexpr/relops/4.cc: New.
	* testsuite/experimental/optional/constexpr/relops/5.cc: New.
	* testsuite/experimental/optional/constexpr/relops/6.cc: New.
	* testsuite/experimental/optional/in_place.cc: New.
	* testsuite/experimental/optional/make_optional.cc: New.
	* testsuite/experimental/optional/nullopt.cc: New.
	* testsuite/experimental/optional/observers/1.cc: New.
	* testsuite/experimental/optional/observers/2.cc: New.
	* testsuite/experimental/optional/observers/3.cc: New.
	* testsuite/experimental/optional/observers/4.cc: New.
	* testsuite/experimental/optional/observers/5.cc: New.
	* testsuite/experimental/optional/relops/1.cc: New.
	* testsuite/experimental/optional/relops/2.cc: New.
	* testsuite/experimental/optional/relops/3.cc: New.
	* testsuite/experimental/optional/relops/4.cc: New.
	* testsuite/experimental/optional/relops/5.cc: New.
	* testsuite/experimental/optional/relops/6.cc: New.
	* testsuite/experimental/optional/requirements.cc: New.
	* testsuite/experimental/optional/swap/1.cc: New.

From-SVN: r204299
2013-11-01 20:08:39 +00:00
Jonathan Wakely d081231ab5 N3421 C++1y Transparent functors
N3421 C++1y Transparent functors
	* include/bits/stl_function.h (plus<void>, minus<void>,
	multiplies<void>, divides<void>, modulus<void>, negate<void>,
	equal_to<void>, not_equal_to<void>, greater<void>, less<void>,
	greater_equal<void>, less_equal<void>, logical_and<void>,
	logical_or<void>, logical_not<void>, bit_and<void>, bit_or<void>,
	bit_xor<void>, bit_not<void>): Define.
	* doc/xml/manual/status_cxx2014.xml: Update.
	* testsuite/20_util/function_objects/comparisons_void.cc: New.

	* include/bits/stl_function.h: Implement N3421.
	* testsuite/20_util/function_objects/comparisons_void.cc: New.

From-SVN: r204290
2013-11-01 11:07:15 +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 0a466ec0c7 48631_neg.cc: Tweak dg-prune.
2013-10-31  Paolo Carlini  <paolo.carlini@oracle.com>

	* testsuite/20_util/default_delete/48631_neg.cc: Tweak dg-prune.

From-SVN: r204253
2013-10-31 12:38:02 +00:00
Jonathan Wakely 2283f03ac9 pointer_partial_void.cc: Fix and enable VERIFY tests.
* testsuite/29_atomics/atomic/operators/pointer_partial_void.cc: Fix
	and enable VERIFY tests.

From-SVN: r204231
2013-10-30 22:05:17 +00:00
Jonathan Wakely 8d52ed5c81 shared_ptr (__shared_ptr): Assert non-void pointer.
* include/bits/shared_ptr (__shared_ptr): Assert non-void pointer.
	* include/bits/shared_ptr (default_delete): Likewise.
	* testsuite/20_util/shared_ptr/cons/58839.cc: Do not use
	default_delete<void>.
	* testsuite/20_util/shared_ptr/cons/void_neg.cc: New.
	* testsuite/20_util/default_delete/void_neg.cc: New.
	* testsuite/20_util/shared_ptr/cons/43820_neg.cc: Adjust line numbers.
	* testsuite/20_util/unique_ptr/assign/48635_neg.cc: Likewise.

From-SVN: r204225
2013-10-30 19:48:52 +00:00
Jonathan Wakely c8c0f5577d re PR libstdc++/58839 (dereferencing void* in shared_ptr(unique_ptr&& u) constructor)
PR libstdc++/58839
	* include/bits/shared_ptr_base.h
	(__shared_ptr<T>::__shared_ptr(unique_ptr<U,D>&&)): Only use addressof
	when unique_ptr<U,D>::pointer is not a built-in pointer type.
	* testsuite/20_util/shared_ptr/cons/58839.cc: New.
	* testsuite/20_util/enable_shared_from_this/members/assign.cc: New.
	* testsuite/20_util/enable_shared_from_this/members/unique_ptr.cc: New.

From-SVN: r204184
2013-10-29 21:33:29 +00:00
Jonathan Wakely da2e699194 hashtable.cc (__access_protected_ctor): Define and use new type instead of _Hashtable_ebo_helper.
* include/bits/hashtable.cc (__access_protected_ctor): Define and use
	new type instead of _Hashtable_ebo_helper.
	* testsuite/23_containers/unordered_set/
	not_default_constructible_hash_neg.cc: Adjust line number.

From-SVN: r204182
2013-10-29 21:19:34 +00:00
Tim Shen 9f0d9611e7 regex.h: Remove unnecessary friends.
2013-10-26  Tim Shen  <timshen91@gmail.com>

	* include/bits/regex.h: Remove unnecessary friends.
	* include/bits/regex.tcc (__regex_algo_impl<>): Move __get_executor
	to here.
	* include/bits/regex_executor.h: Remove _DFSExecutor and _BFSExecutor;
	they are merged into _Executor. Eliminate quantifier tracking part, so
	it's faster.
	* include/bits/regex_executor.tcc: Implement _Executor.
	* testsuite/28_regex/algorithms/regex_match/ecma/char/ungreedy.cc: New.
	* testsuite/28_regex/algorithms/regex_search/ecma/greedy.cc: Adjust
	duplicate testcases.
	* testsuite/performance/28_regex/split.h: New.
	* testsuite/performance/28_regex/split_bfs.cc: New.
	* testsuite/util/testsuite_regex.h: Adjust behavior of two-executors
	agreement judger: do not compare match_results when executor return
	false.

From-SVN: r204093
2013-10-26 16:09:28 +00:00
François Dumont 3ff4317f1c formatter.h (__check_singular): Add const on iterator reference.
2013-10-25  François Dumont  <fdumont@gcc.gnu.org>

	* include/debug/formatter.h (__check_singular): Add const on
	iterator reference.
	* include/debug/functions.h (__check_singular): Likewise.
	(__check_singular(const _Safe_iterator<_Ite, _Seq>&)): Delete.
	(__check_dereferenceable(const _Ite&)): Add const on iterator
	reference.
	(__check_dereferenceable(const _Safe_local_iterator<>&)): New.
	* include/debug/safe_iterator.h (__check_singular_aux): Review
	comment.
	* testsuite/23_containers/vector/debug/debug_functions.cc: New.
	* testsuite/23_containers/unordered_set/debug/debug_functions.cc:
	New.

From-SVN: r204075
2013-10-25 19:25:06 +00:00
Chris Jefferson c2240038a6 testsuite_containergen.h: New.
2013-10-23  Chris Jefferson  <chris@bubblescope.net>
	    Paolo Carlini  <paolo.carlini@oracle.com>

	* testsuite/util/testsuite_containergen.h: New.
	* testsuite/util/testsuite_iterators.h (test_container<>::val): Add.
	* testsuite/25_algorithms/nth_element/random_test.cc: New, use the
	above.
	* testsuite/25_algorithms/partial_sort/random_test.cc: Likewise.
	* testsuite/25_algorithms/partial_sort_copy/random_test.cc: Likewise.
	* testsuite/25_algorithms/sort/random_test.cc: Likewise.

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

From-SVN: r203995
2013-10-23 22:19:30 +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
Paolo Carlini f361277750 contrib.texi ([Fran@,{c}ois Dumont], [...]): New entries.
2013-10-22  Paolo Carlini  <paolo.carlini@oracle.com>

	* doc/contrib.texi ([Fran@,{c}ois Dumont], [Tim Shen],
	[Ed Smith-Rowland]): New entries.
	([Stephen M. Webb]): Update.

From-SVN: r203959
2013-10-23 11:59:07 +00:00
Paolo Carlini 1a0e9d1cb9 re PR libstdc++/58815 (Casting/Conversion operator for std::decimal not supported)
2013-10-23  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/58815
	* include/decimal/decimal (decimal32::operator long long(),
	decimal64::operator long long(), decimal128::operator long long()):
	Add in c++11 mode per n3407.
	* testsuite/decimal/pr58815.cc: New.

From-SVN: r203956
2013-10-23 11:48:26 +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
Tim Shen 603b781be4 regex.h: Remove virtual class _Automaton.
2013-10-20  Tim Shen  <timshen91@gmail.com>

	* include/bits/regex.h: Remove virtual class _Automaton.
	* include/bits/regex_automaton.h: Likewise.
	* include/bits/regex.tcc: Adjust comment for policy changing.
	* include/bits/regex_executor.h: Update comments of complexity.
	* include/bits/regex_executor.tcc: Adjust executor choosing
	policy. Now DFS executor is the default one.
	* testsuite/util/testsuite_regex.h (regex_match_debug,
	regex_search_debug): Adjust for policy changing.

From-SVN: r203875
2013-10-20 10:07:29 +00:00
Chris Jefferson f5b9d5e877 re PR libstdc++/58800 (std::nth_element segfaults on valid input)
2013-10-20  Chris Jefferson  <chris@bubblescope.net>
	    Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/58800
	* include/bits/stl_algo.h (__unguarded_partition_pivot): Change
	__last - 2 to __last - 1.
	* testsuite/25_algorithms/nth_element/58800.cc: New

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

From-SVN: r203872
2013-10-20 09:07:36 +00:00
Edward Smith-Rowland 6b8fe121af re PR libstdc++/58729 (tr2::dynamic_bitset::resize fails)
2013-10-18  Edward Smith-Rowland  <3dw4rd@verizon.net>

	PR libstdc++/58729
	* include/tr2/dynamic_bitset (_M_resize, resize): Use input value
	to set bits; (_M_do_left_shift, _M_do_right_shift, _M_do_to_ulong,
	_M_do_to_ullong, _M_do_find_first, _M_do_find_next, _M_copy_from_ptr,
	operator>>): Move long methods outline to...
	* include/tr2/dynamic_bitset.tcc: New.
	* include/Makefile.am: Add dynamic_bitset.tcc.
	* include/Makefile.in: Add dynamic_bitset.tcc.
	* testsuite/tr2/dynamic_bitset/pr58729.cc: New.

From-SVN: r203841
2013-10-19 01:31:19 +00:00
Tim Shen 7948838864 regex_scanner.tcc: (_Scanner<>::_M_scan_normal...
2013-10-18  Tim Shen  <timshen91@gmail.com>

	* include/bits/regex_scanner.tcc: (_Scanner<>::_M_scan_normal,
	_Scanner<>::_M_eat_escape_ecma, _Scanner<>::_M_eat_escape_posix,
	_Scanner<>::_M_eat_escape_awk): Narrow character before finding in maps.
	* testsuite/28_regex/algorithms/regex_match/ecma/wchar_t/cjk_match.cc:
	New.

From-SVN: r203827
2013-10-18 16:13:07 +00:00
Diego Novillo 37ea0d87a3 Add missing function in 20_util/exchange/1.cc.
When this test is compiled at -O0, the compiler does not remove the
address comparison. This causes a link failure, since the body of f()
is missing.

	* testsuite/20_util/exchange/1.cc: Add missing function
	bodies.

From-SVN: r203629
2013-10-15 14:51:37 -04:00
Marcus Shawcroft 000ebb9242 Adding missing dg-require-atomic-builtins to libstdc++ test case.
From-SVN: r203425
2013-10-11 11:15:01 +00:00
Jonathan Wakely fd673f296a 58659.cc: Use VERIFY instead of aborting.
* testsuite/20_util/shared_ptr/cons/58659.cc: Use VERIFY instead of
	aborting.

From-SVN: r203325
2013-10-09 19:37:26 +01:00
Marcus Shawcroft 57b4899877 Fix unprototyped abort() introduced in libstdc++/58659.cc testcase.
From-SVN: r203321
2013-10-09 14:26:52 +00:00
Jonathan Wakely 9ae63018d7 * testsuite/*: Remove stray semi-colons after function definitions.
From-SVN: r203279
2013-10-08 14:54:26 +01:00
Jonathan Wakely 61bf02e007 re PR libstdc++/58659 (Construction of shared_ptr from unique_ptr mismatches new/delete and std::allocator for __shared_ptr_count)
PR libstdc++/58659
	* include/bits/shared_ptr_base.h (__shared_count::__shared_count(P,D)):
	Delegate to constructor taking allocator.
	(__shared_count::_S_create_from_up): Inline into ...
	(__shared_count::__shared_count(unique_ptr<Y,D>&&): Here. Use
	std::conditional instead of constrained overloads. Allocate memory
	using the allocator type that will be used for deallocation.
	* testsuite/20_util/shared_ptr/cons/58659.cc: New.
	* testsuite/20_util/shared_ptr/cons/43820_neg.cc: Adjust.

From-SVN: r203274
2013-10-08 13:33:37 +01:00
Tim Shen 18971f1fc3 regex_executor.h: Add _TodoList class.
2013-10-08  Tim Shen  <timshen91@gmail.com>

	* include/bits/regex_executor.h: Add _TodoList class.
	* include/bits/regex_executor.tcc (_BFSExecutor<>::_M_main): Add
	_M_match_stack and _M_stack to make everything faster. Break if
	_M_stack is empty, to reduce unnecessary idling.
	* testsuite/performance/28_regex/split.cc: New.

From-SVN: r203261
2013-10-08 03:41:14 +00:00
Tim Shen 6cb4308702 regex.h: (regex_token_iterator<>::regex_token_iterator): Fix compile error.
2013-10-06  Tim Shen  <timshen91@gmail.com>

	* include/bits/regex.h: (regex_token_iterator<>::regex_token_iterator):
	Fix compile error.
	* include/bits/regex.tcc: (regex_replace<>): Remove default parameter.

2013-10-06  Tim Shen  <timshen91@gmail.com>

	* include/bits/regex.h (__regex_algo_impl<>, regex_match<>,
	regex_search<>): New abstract function for regex_match and regex_search.
	* include/bits/regex.tcc (__regex_algo_impl<>): Implement.
	* include/bits/regex_executor.h
	(_Executor<>::_M_lookahead,
	 _DFSExecutor<>::_M_clone,
	 _BFSExecutor<>::_M_clone): Let _M_clone to choose which executor to
	use.
	* include/bits/regex_executor.tcc (__get_executor<>): Update the
	definition to support __policy.
	* testsuite/28_regex/algorithms/regex_match/awk/cstring_01.cc: Use
	*_debug.
	* testsuite/28_regex/algorithms/regex_match/basic/empty_range.cc: Same.
	* testsuite/28_regex/algorithms/regex_match/basic/string_01.cc: Same.
	* testsuite/28_regex/algorithms/regex_match/basic/string_range_00_03.cc:
	Same.
	* testsuite/28_regex/algorithms/regex_match/basic/string_range_01_03.cc:
	Same.
	* testsuite/28_regex/algorithms/regex_match/basic/string_range_02_03.cc:
	Same.
	* testsuite/28_regex/algorithms/regex_match/ecma/char/53622.cc: Same.
	* testsuite/28_regex/algorithms/regex_match/ecma/char/57173.cc: Same.
	* testsuite/28_regex/algorithms/regex_match/ecma/char/58576.cc: Same.
	* testsuite/28_regex/algorithms/regex_match/ecma/char/anymatcher.cc:
	Same.
	* testsuite/28_regex/algorithms/regex_match/ecma/char/backref.cc: Same.
	* testsuite/28_regex/algorithms/regex_match/ecma/char/empty_range.cc:
	Same.
	* testsuite/28_regex/algorithms/regex_match/ecma/char/emptygroup.cc:
	Same.
	* testsuite/28_regex/algorithms/regex_match/ecma/char/hex.cc: Same.
	* testsuite/28_regex/algorithms/regex_match/ecma/char/quoted_char.cc:
	Same.
	* testsuite/28_regex/algorithms/regex_match/ecma/wchar_t/anymatcher.cc:
	Same.
	* testsuite/28_regex/algorithms/regex_match/ecma/wchar_t/hex.cc: Same.
	* testsuite/28_regex/algorithms/regex_match/extended/
	string_bracket_01.cc: Same.
	* testsuite/28_regex/algorithms/regex_match/extended/cstring_plus.cc:
	Same.
	* testsuite/28_regex/algorithms/regex_match/extended/
	string_questionmark.cc: Same.
	* testsuite/28_regex/algorithms/regex_match/extended/cstring_range.cc:
	Same.
	* testsuite/28_regex/algorithms/regex_match/extended/string_any.cc:
	Same.
	* testsuite/28_regex/algorithms/regex_match/extended/
	string_dispatch_01.cc: Same.
	* testsuite/28_regex/algorithms/regex_match/extended/
	string_range_00_03.cc: Same.
	* testsuite/28_regex/algorithms/regex_match/extended/
	string_range_01_03.cc: Same.
	* testsuite/28_regex/algorithms/regex_match/extended/
	string_range_02_03.cc: Same.
	* testsuite/28_regex/algorithms/regex_match/extended/wstring_locale.cc:
	Same.
	* testsuite/28_regex/algorithms/regex_search/basic/string_01.cc: Same.
	* testsuite/28_regex/algorithms/regex_search/ecma/assertion.cc: Same.
	* testsuite/28_regex/algorithms/regex_search/ecma/flags.cc: Same.
	* testsuite/28_regex/algorithms/regex_search/ecma/greedy.cc: Same.
	* testsuite/28_regex/algorithms/regex_search/ecma/string_01.cc: Same.
	* testsuite/28_regex/match_results/format.cc: Same.
	* testsuite/util/testsuite_regex.h
	(regex_match_debug<>, regex_search_debug<>): Implement.

From-SVN: r203231
2013-10-06 17:53:14 +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 3fd113d7f1 re PR libstdc++/58594 (std::make_shared does not accept const types as parameters)
PR libstdc++/58594
	* include/bits/shared_ptr_base.h
	(_Sp_counted_ptr_inplace::_M_get_deleter()): Cast away cv-quals.
	* testsuite/20_util/shared_ptr/creation/58594.cc: New.

From-SVN: r203131
2013-10-02 20:55:14 +01:00
Tim Shen 756aa0c302 2013-10-02 Tim Shen <timshen91@gmail.com>
* include/bits/regex_compiler.h
	(_BracketMatcher<>::_M_add_equivalence_class): Implement it correctly.
	* include/bits/regex_compiler.tcc (_BracketMatcher<>::operator()):
	Add _M_equiv_set support.
	* testsuite/28_regex/algorithms/regex_match/extended/
	cstring_bracket_01.cc: Add new "[[=a=]]" testcase.

From-SVN: r203117
2013-10-02 15:13:18 +00:00
Tim Shen 70b50ed7b5 re PR libstdc++/58576 (std::regex_match() reports mismatched braces on a valid regex)
2013-10-01  Tim Shen  <timshen91@gmail.com>

	PR libstdc++/58576
	* include/bits/regex_automaton.tcc (_NFA<>::_M_eliminate_dummy)
	(_StateSeq<>::_M_clone): Add _S_opcode_subexpr_lookahead branch.
	* testsuite/28_regex/algorithms/regex_match/ecma/char/58576.cc: New.

From-SVN: r203067
2013-10-01 15:26:50 +00:00
Chris Jefferson a10bad862f re PR libstdc++/58437 (Sorting value in reverse order is much slower compare to gcc44)
2013-09-30  Chris Jefferson  <chris@bubblescope.net>

	PR libstdc++/58437
	* include/bits/stl_algo.h (__move_median_first): Rename to
	__move_median_to_first, change to take an addition argument.
	(__unguarded_partition_pivot): Adjust.
	* testsuite/performance/25_algorithms/sort.cc: New.
	* testsuite/performance/25_algorithms/sort_heap.cc: Likewise.
	* testsuite/performance/25_algorithms/stable_sort.cc: Likewise.

From-SVN: r203035
2013-09-30 17:42:31 +00:00
Tim Shen 8d60fca50e regex_scanner.tcc (_Scanner<>::_M_eat_escape_posix): Let ordinary char escaping in POSIX be valid.
2013-09-28  Tim Shen <timshen91@gmail.com>

	* include/bits/regex_scanner.tcc (_Scanner<>::_M_eat_escape_posix):
	Let ordinary char escaping in POSIX be valid.
	* testsuite/28_regex/basic_regex/ctors/basic/raw_string.cc: Test this
	change.

From-SVN: r203005
2013-09-28 13:41:09 +00:00
François Dumont ea89b2482f predefined_ops.h: New.
2013-09-27  François Dumont  <fdumont@gcc.gnu.org>

	* include/bits/predefined_ops.h: New.
	* include/bits/stl_heap.h: Include <bits/predefined_ops.h>.
	(__is_heap_until, __push_heap, __adjust_heap, __pop_heap): Remove
	algo duplication.
	(__is_heap): Adapt.
	(__make_heap): New.
	(make_heap): Adapt to use latter.
	(__sort_heap): New.
	(sort_heap): Adapt to use latter.
	* include/bits/algobase.h: Include <bits/predefined_ops.h>.
	(__lexicographical_compare_impl): New.
	(__lexicographical_compare<false>::__lc): Adapt to use latter.
	(lexicographical_compare): Likewise.
	(__lower_bound): New.
	(lower_bound): Adapt to use latter.
	(equal): Use _GLIBCXX_STD_A::equal in N3671 overloads.
	(__mismatch): New.
	(mismatch): Use latter.
	* include/bits/algo.h: Include <bits/predefined_ops.h>. Remove
	<functional> include.
	(__move_median_first, __find, __find_if, __find_if_not): Remove
	algo duplication.
	(__find_end): Likewise.
	(__search_n): Rename into ...
	(__search_n_aux): ... this.
	(__search_n): Renew, use latter.
	(search_n): Use latter.
	(__search): New.
	(search): Use latter.
	(__find_end): Likewise.
	(__remove_copy_if): New.
	(remove_copy): Use latter.
	(__adjacent_find): New.
	(adjacent_find): Use latter.
	(__unique): New.
	(unique): Use latter.
	(__unique_copy): Remove algo duplication.
	(__stable_partition): New.
	(stable_partition): Use latter.
	(__heap_select): Remove algo duplication, use __make_heap.
	(__partial_sort): New, use latter.
	(partial_sort): Use latter.
	(__partial_sort_copy): New.
	(partial_sort_copy): Use latter.
	(__unguarded_linear_insert, __insertion_sort): Remove algo
	duplication.
	(__unguarded_insertion_sort, __final_insertion_sort): Likewise.
	(__unguarded_partition, __unguarded_partition_pivot): Likewise.
	(__partial_sort): New.
	(partial_sort): Use latter.
	(__sort): New.
	(sort): Use latter.
	(lower_bound): Use __lower_bound.
	(__upper_bound): New.
	(upper_bound): Use latter.
	(__equal_range): New.
	(equal_range): Use latter.
	(__move_merge_adaptive, __move_merge_adaptive_backward): Remove
	algo duplication.
	(__merge_adaptive, __merge_without_buffer): Likewise.
	(__inplace_merge): New.
	(inplace_merge): Use latter.
	(__move_merge, __merge_sort_loop, __chunk_insertion_sort): Remove
	algo duplication.
	(__merge_sort_with_buffer, __stable_sort_adaptive): Likewise.
	(__inplace_stable_sort): Likewise.
	(__include): New.
	(includes): Use latter.
	(__next_permutation): New.
	(next_permutation): Use latter.
	(__prev_permutation): New.
	(prev_permutation): Use latter.
	(__replace_copy_if): New.
	(replace_copy): Use latter.
	(__is_sorted_until): New.
	(is_sorted_unitl): Use latter.
	(__minmax_element): New.
	(minmax_element): Use latter.
	(__is_permutation): New.
	(is_permutation): Use latter.
	(__adjacent_find): New.
	(adjacent_find): Use latter.
	(__count_if): New.
	(count): Use latter.
	(count_if): Likewise.
	(__merge): New.
	(merge): Use latter.
	(__stable_sort): New.
	(stable_sort): Use latter.
	(__set_union): New.
	(set_union): Use latter.
	(__set_intersection): New.
	(set_intersection): Use latter.
	(__set_difference): New.
	(set_difference): Use latter.
	(__set_symmetric_difference): New.
	(set_symmetric_difference): Use latter.
	(__min_element): New.
	(min_element): Use latter.
	(__max_element): New.
	(max_element): Use latter.
	* include/Makefile.am: Add predefined_ops.h.
	* include/Makefile.in: Regenerate.
	* include/parallel/algobase.h (equal, mismatch): Add overloads
	from N3671.
	* testsuite/25_algorithms/is_permutation/vectorbool.cc: New.
	* testsuite/25_algorithms/adjacent_find/vectorbool.cc: Likewise.
	* testsuite/25_algorithms/find/vectorbool.cc: Likewise.
	* testsuite/25_algorithms/find_if/vectorbool.cc: Likewise.
	* testsuite/25_algorithms/find_first_of/vectorbool.cc: Likewise.
	* testsuite/25_algorithms/heap/vectorbool.cc: Likewise.
	* testsuite/25_algorithms/find_end/vectorbool.cc: Likewise.
	* testsuite/25_algorithms/find_if_not/vectorbool.cc: Likewise.

From-SVN: r202992
2013-09-27 21:17:36 +00: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
Tim Shen d4e1260101 regex_error.h: Remove _S_error_last to follow the standard.
2013-09-26  Tim Shen  <timshen91@gmail.com>

	* regex_error.h: Remove _S_error_last to follow the standard.
	* regex_scanner.tcc:
	(_Scanner<_FwdIter>::_M_scan_in_brace): Change error_brace to
	error_badbrace.
	(_Scanner<>::_M_eat_escape_posix): Extended doesn't support
	back-reference.
	* testsuite/28_regex/algorithms/regex_match/ecma/char/53622.cc:
	Move here from ../../extended.
	* testsuite/28_regex/algorithms/regex_match/ecma/char/57173.cc:
	Likewise.

From-SVN: r202958
2013-09-26 21:48:04 +00:00
Tim Shen c2669da93d Makefile.am: Add regex.tcc.
2013-09-24  Tim Shen  <timshen91@gmail.com>

	* include/Makefile.am: Add regex.tcc.
	* include/Makefile.in: Regenerate.
	* include/bits/regex.h: Remove definitions to regex.tcc.
	* include/bits/regex.tcc: New.
	(match_results::format, regex_replace): Implement;
	* include/bits/regex_compiler.h: Move _M_flags to the top of class
	member list, because other members' initialization depend on it.
	* include/bits/regex_compiler.tcc
	(_Compiler<>::_Compiler): Adjust member initializations.
	(_Compiler<>::_M_quantifier): Fix ungreedy interval quantifier.
	* include/bits/regex_executor.h: Remove _RegexT from _*Executor classes.
	In the future, all regex classes may refactor to *Impl style.
	* include/bits/regex_executor.tcc (_Executor::_M_set_results):
	Merge identical code from _*Executor classes.
	* testsuite/28_regex/algorithms/regex_match/extended/
	string_dispatch_01.cc (fake_match<>): Adjust the hacking-style testcase
	caller for new __get_executors interface.
	* testsuite/28_regex/algorithms/regex_replace/char/basic_replace.cc:
	New.
	* testsuite/28_regex/match_results/format.cc: New.
	* testsuite/28_regex/traits/char/lookup_collatename.cc: Remove digraph
	testcase.
	* testsuite/28_regex/traits/wchar_t/lookup_collatename.cc: Likewise.

From-SVN: r202858
2013-09-24 02:05:00 +00: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
Jakub Jelinek bd599dea43 re PR testsuite/57605 (colors break note pruning in the testsuite)
PR testsuite/57605
libstdc++-v3/
	* testsuite/lib/libstdc++.exp (libstdc++_init): Prepend
	-fdiagnostics-color=never to cxxflags.
libmudflap/
	* testsuite/lib/libmudflap.exp (libmudflap-init): Append
	-fdiagnostics-color=never to cxxflags.
libgomp/
	* testsuite/lib/libgomp.exp: Add -fdiagnostics-color=never to
	ALWAYS_CFLAGS.

From-SVN: r202791
2013-09-20 19:52:29 +02:00
Marc Glisse d15ac9d9a3 re PR libstdc++/58338 (Add noexcept to functions with a narrow contract)
2013-09-20  Marc Glisse  <marc.glisse@inria.fr>

	PR libstdc++/58338
	* include/bits/allocator.h (__alloc_swap::_S_do_it,
	__shrink_to_fit_aux::_S_do_it): Mark as noexcept.
	* include/bits/basic_string.h (basic_string::_Rep) [_S_empty_rep,
	_M_is_leaked, _M_is_shared, _M_set_leaked, _M_set_sharable,
	_M_set_length_and_sharable, _M_dispose]: Likewise.
	(basic_string::_Alloc_hider::_Alloc_hider): Likewise.
	(basic_string) [_M_data, _M_rep, _M_ibegin, _M_iend, _M_limit,
	_M_disjunct, _M_copy, _M_move, _M_assign, _S_copy_chars, _S_compare,
	_S_empty_rep, shrink_to_fit, operator[] const, front const, back const]:
	Likewise.
	[clear]: Link to PR 56166.
	[swap]: Link to PR 58265.
	* include/bits/stl_deque.h (_Deque_iterator) [_S_buffer_size,
	_Deque_iterator, _M_const_cast, operator*, operator->, operator++,
	operator--, operator+=, operator+, operator-=, operator-, operator[],
	_M_set_node]: Mark as noexcept.
	(operator==(const _Deque_iterator&, const _Deque_iterator&),
	operator!=(const _Deque_iterator&, const _Deque_iterator&),
	operator<(const _Deque_iterator&, const _Deque_iterator&),
	operator>(const _Deque_iterator&, const _Deque_iterator&),
	operator<=(const _Deque_iterator&, const _Deque_iterator&),
	operator>=(const _Deque_iterator&, const _Deque_iterator&),
	operator-(const _Deque_iterator&, const _Deque_iterator&),
	operator+(ptrdiff_t, const _Deque_iterator&)): Likewise.
	(_Deque_base) [_Deque_base(const allocator_type&)]: Add missing call to
	_M_initialize_map.
	[~_Deque_base, _M_deallocate_node, _M_deallocate_map, _M_destroy_nodes]:
	Mark as noexcept.
	(_Deque_base::_Deque_impl) [_Deque_impl(const _Tp_alloc_type&),
	_Deque_impl(_Tp_alloc_type&&)]: Likewise.
	(deque) [_S_buffer_size, operator=(deque&&), shrink_to_fit, operator[],
	front, back, pop_front, pop_back, swap]: Likewise.
	[deque(), deque(const allocator_type&)]: Merge.
	* include/debug/deque (deque) [operator=(deque&&), shrink_to_fit,
	operator[], front, back, pop_front, pop_back, swap]: Mark as noexcept.
	* include/profile/deque (deque) [operator=(deque&&), operator[], front,
	back, pop_front, pop_back, swap]: Likewise.
	* testsuite/23_containers/deque/requirements/dr438/assign_neg.cc:
	Adjust line number.
	* 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/deque/requirements/dr438/insert_neg.cc:
	Likewise.

From-SVN: r202781
2013-09-20 15:50:09 +00: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 b21abceec3 regex.h: Add friend classes.
2013-09-18  Tim Shen  <timshen91@gmail.com>

	* include/bits/regex.h: Add friend classes.
	(match_results<>::position, regex_iterator<>::operator++):
	Implement position specification in regex_iterator.
	(regex_match<>, regex_search<>):
	Move match_results initializations to these function. Remove `todo`.
	* include/bits/regex_compiler.tcc:
	(_Compiler<>::_M_quantifier): Fix greedy/ungreedy of interval matching.
	* include/bits/regex_constants.h:
	Fix indentation. Change match_flag_type to enum type.
	* include/bits/regex_executor.h:
	Merge identical code to the base class _Executor.
	Support flags in regex_constants.
	* include/bits/regex_executor.tcc: Likewise.
	* include/bits/regex_scanner.h: Add comments.
	* include/bits/regex_scanner.tcc: Same.
	* testsuite/28_regex/algorithms/regex_search/ecma/assertion.cc:
	Add a testcase.
	* testsuite/28_regex/algorithms/regex_search/ecma/flags.cc: New.
	* testsuite/28_regex/iterators/regex_iterator/char/
	string_position_01.cc: Remove `xfail`.
	* testsuite/28_regex/iterators/regex_iterator/wchar_t/string_02.cc:
	Remove `xfail` and make the case really work.

From-SVN: r202706
2013-09-18 15:56:20 +00:00
Paolo Carlini 64bc8861e9 search_n.cc: Fix typo.
2013-09-18  Paolo Carlini  <paolo.carlini@oracle.com>

	* testsuite/performance/25_algorithms/search_n.cc: Fix typo.

From-SVN: r202704
2013-09-18 14:49:28 +00:00
Marc Glisse 837bf5116d 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/list.tcc (_List_base::_M_clear, list::erase): Mark as
	noexcept.
	* include/bits/stl_list.h (_List_iterator) [_List_iterator,
	_M_const_cast, operator*, operator->, operator++, operator--,
	operator==, operator!=]: Likewise.
	(_List_const_iterator) [_List_const_iterator, _M_const_cast, operator*,
	operator->, operator++, operator--, operator==, operator!=]: Likewise.
	(operator==(const _List_iterator&, const _List_const_iterator&),
	operator!=(const _List_iterator&, const _List_const_iterator&)):
	Likewise.
	(_List_impl) [_List_impl(const _Node_alloc_type&),
	_List_impl(_Node_alloc_type&&)]: Likewise.
	(_List_base) [_M_put_node, _List_base(const _Node_alloc_type&),
	_List_base(_List_base&&), _M_clear, _M_init]: Likewise.
	(list) [list(), list(const allocator_type&)]: Merge.
	(list) [list(const allocator_type&), front, back, pop_front, pop_back,
	erase, _M_erase]: Mark as noexcept.
	* include/debug/list (list) [list(const _Allocator&), front, back,
	pop_front, pop_back, _M_erase, erase]: Likewise.
	* include/profile/list (list) [list(const _Allocator&), front, back,
	pop_front, pop_back, erase]: Likewise.
	* testsuite/23_containers/list/requirements/dr438/assign_neg.cc:
	Adjust line number.
	* testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc:
	Likewise.
	* testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc:
	Likewise.
	* testsuite/23_containers/list/requirements/dr438/insert_neg.cc:
	Likewise.

From-SVN: r202699
2013-09-18 11:21:51 +00:00
Marc Glisse 757b16440b re PR libstdc++/58338 (Add noexcept to functions with a narrow contract)
2013-09-17  Marc Glisse  <marc.glisse@inria.fr>

	PR libstdc++/58338
	* include/bits/stl_vector.h (vector::vector(),
	vector::vector(const allocator_type&)): Merge.
	(_Vector_impl::_Vector_impl(_Tp_alloc_type const&),
	_Vector_impl::_Vector_impl(_Tp_alloc_type&&),
	_Vector_impl::_M_swap_data,
	_Vector_base::_Vector_base(const allocator_type&),
	_Vector_base::_Vector_base(allocator_type&&),
	_Vector_base::_Vector_base(_Vector_base&&), _Vector_base::~_Vector_base,
	vector::vector(const allocator_type&), vector::operator[],
	vector::operator[] const, vector::front, vector::front const,
	vector::back, vector::back const, vector::pop_back,
	vector::_M_erase_at_end): Mark as noexcept.
	* include/debug/vector (vector::vector(const _Allocator&),
	vector::operator[], vector::operator[] const, vector::front,
	vector::front const, vector::back, vector::back const, vector::pop_back,
	_M_requires_reallocation, _M_update_guaranteed_capacity,
	_M_invalidate_after_nth): Mark as noexcept.
	* include/profile/vector (vector::vector(const _Allocator&),
	vector::operator[], vector::operator[] const, vector::front,
	vector::front const, vector::back, vector::back const): Mark as
	noexcept.
	(vector::vector(vector&&, const _Allocator&)): Remove wrong noexcept.
	* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
	Adjust line number.
	* 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/vector/requirements/dr438/insert_neg.cc:
	Likewise.

From-SVN: r202650
2013-09-17 12:23:54 +00:00
Tim Shen 7b86458e38 regex.h (regex_match<>, [...]): Change regex_executor caller.
2013-09-14  Tim Shen  <timshen91@gmail.com>

	* include/bits/regex.h (regex_match<>, regex_search<>):
	Change regex_executor caller. Now use their return value instead
	of checking __m[0].matched to find out if it's successful.
	(regex_search<>): Move the search logic to regex_executor.
	* include/bits/regex_automaton.h: Add some new _Opcode. Refactor
	_NFA::_M_insert_*.
	* include/bits/regex_automaton.tcc: Add DEBUG dump for new
	_Opcode. Refactor _NFA::_M_insert_*.
	* include/bits/regex_compiler.h (_Compiler<>::_M_get_nfa):
	Use make_shared instead of construct by hand.
	* include/bits/regex_compiler.tcc: Implement _Compiler<>::_M_assertion.
	* include/bits/regex_constants.h: Fix indentation and line breaking.
	* include/bits/regex_executor.h: Add _ResultsEntry to support
	greedy/ungreedy mode. Move regex_search logic here.
	* include/bits/regex_executor.tcc: Implement assertions and
	greedy/ungreedy matching.
	* include/bits/regex_scanner.h: Add a new token _S_token_ungreedy.
	* include/bits/regex_scanner.tcc: Parse a new token _S_token_ungreedy.
	* testsuite/28_regex/algorithms/regex_search/ecma/assertion.cc: New.
	* testsuite/28_regex/algorithms/regex_search/ecma/greedy.cc: New.
	* testsuite/28_regex/algorithms/regex_search/ecma/string_01.cc:
	Fix comment.

From-SVN: r202591
2013-09-14 14:23:44 +00:00
Paolo Carlini 4f03875418 re PR libstdc++/58415 (__sso_string_base move constructor does not null terminate local data when moving from empty string)
2013-09-13  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/58415
	* include/ext/sso_string_base.h (__sso_string_base<>::
	__sso_string_base(__sso_string_base&&)): Fix thinkos about
	_M_length vs _M_set_length.
	* testsuite/ext/vstring/cons/58415-1.cc: New.
	* testsuite/ext/vstring/cons/58415-2.cc: Likewise.

From-SVN: r202574
2013-09-13 18:32:42 +00:00
Paolo Carlini 274ddab613 re PR libstdc++/58403 (__normal_iterator triggers odr-use)
2013-09-12  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/58403
	* include/bits/stl_iterator.h (__normal_iterator<>::operator[],
	operator+=, operator+, operator-=, operator-): Take the argument
	by value.
	* testsuite/24_iterators/normal_iterator/58403.cc: New.

From-SVN: r202531
2013-09-12 15:15:34 +00:00
Mitsuru Kariya 4b47d65500 re PR libstdc++/58358 (search_n has a Complexity violation for random access iterator)
2013-09-11  Mitsuru Kariya  <kariya_mitsuru@hotmail.com>
	    Chris Jefferson  <chris@bubblescope.net>

	PR libstdc++/58358
	* include/bits/stl_algo.h (search_n): Fix to guarantee a number
	of comparisons <= number of elements in the range.
	* testsuite/25_algorithms/search_n/58358.cc: New.
	* testsuite/25_algorithms/search_n/iterator.cc: Extend.

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

From-SVN: r202510
2013-09-11 22:24:50 +00:00
Ed Smith-Rowland df7d9dfde3 value.cc: Change template args from char to wchar_t, literals from 'x' to L'x'.
2013-09-10  Ed Smith-Rowland  <3dw4rd@verizon.net>

	* testsuite/28_regex/traits/wchar_t/value.cc: Change template args
	from char to wchar_t, literals from 'x' to L'x'.

From-SVN: r202487
2013-09-11 01:27:31 +00:00
Tim Shen 7c812a2a57 regex_automaton.h: Add dummy node type.
2013-09-05  Tim Shen  <timshen91@gmail.com>

	* include/bits/regex_automaton.h: Add dummy node type. Rewrite
	_StateSeq.
	* include/bits/regex_automaton.tcc: Implement them.
	* include/bits/regex_compiler.h: Rewrite _Compiler to use new
	_StateSeq interfaces.
	* include/bits/regex_compiler.tcc: Implement them.
	* include/bits/regex_scanner.h: Add word boundry assertion token.
	* include/bits/regex_scanner.tcc (_Scanner<>::_M_eat_escape_ecma):
	Support word boundry.
	* testsuite/28_regex/algorithms/regex_match/basic/
	string_range_02_03.cc: Remove "xfail".
	* testsuite/28_regex/algorithms/regex_match/extended/cstring_plus.cc:
	Likewise.
	* testsuite/28_regex/algorithms/regex_match/extended/
	string_range_02_03.cc: Likewise.
	* testsuite/28_regex/algorithms/regex_match/extended/
	cstring_questionmark.cc: Remove xfail and get correct length of
	c-string.
	* testsuite/28_regex/algorithms/regex_match/extended/
	string_range_00_03.cc: Likewise.
	* testsuite/28_regex/algorithms/regex_match/ecma/char/quoted_char.cc:
	New.
	* testsuite/28_regex/algorithms/regex_match/extended/cstring_range.cc:
	New.
	* testsuite/28_regex/iterators/regex_iterator/wchar_t/string_02.cc: New.

From-SVN: r202290
2013-09-05 15:20:39 +00:00
Paolo Carlini e5fbc9fc72 re PR libstdc++/58302 (compilation error : std::negative_binomial_distribution::operator(e, p))
2013-09-03  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/58302
	* include/bits/random.tcc (negative_binomial_distribution<>::
	operator()(_UniformRandomNumberGenerator&, const param_type&):
	Fix typo in template argument.
	* testsuite/26_numerics/random/negative_binomial_distribution/
	operators/58302.cc: New.

From-SVN: r202208
2013-09-03 10:12:19 +00:00
Tim Shen e350969184 regex_automaton.h: Rearrange _NFA's layout.
2013-09-02  Tim Shen  <timshen91@gmail.com>

	* regex_automaton.h: Rearrange _NFA's layout.
	* include/bits/regex_compiler.h: Add _AnyMatcher and _CharMatcher.
	  Rearrange _BracketMatcher's layout.
	  (_BracketMatcher<>::_M_add_char): Use set instead of vector for
	  _M_char_set.
	  (_BracketMatcher<>::_M_add_collating_element): Likewise.
	  (_BracketMatcher<>::_M_make_range): Likewise.
	* include/bits/regex_compiler.tcc (_Compiler<>::_M_atom): Use
	  apropriate constructors of matchers above.
	* testsuite/28_regex/algorithms/regex_match/ecma/char/anymatcher.cc:
	  New.
	* testsuite/28_regex/algorithms/regex_match/ecma/char/backref.cc: New.
	* testsuite/28_regex/algorithms/regex_match/ecma/char/empty_range.cc:
	  New.
	* testsuite/28_regex/algorithms/regex_match/ecma/char/emptygroup.cc:
	  New.
	* testsuite/28_regex/algorithms/regex_match/ecma/char/hex.cc: New.
	* testsuite/28_regex/algorithms/regex_match/ecma/wchar_t/anymatcher.cc:
	  New.
	* testsuite/28_regex/algorithms/regex_match/ecma/wchar_t/hex.cc: New.

From-SVN: r202189
2013-09-02 22:20:56 +00:00
François Dumont 32bb816a91 re PR libstdc++/58148 (Fails to insert iterator range into sequence container with -D_GLIBCXX_DEBUG when conversion is needed)
2013-08-30  François Dumont  <fdumont@gcc.gnu.org>

	PR libstdc++/58148
	* include/debug/functions.h (__foreign_iterator_aux4): Use
	sequence const_pointer as common type to compare pointers. Add a
	fallback overload in case pointers cannot be cast to sequence
	const_pointer.
	* testsuite/23_containers/vector/modifiers/insert/58148.cc: New.

From-SVN: r202121
2013-08-30 20:55:37 +00:00
Tim Shen 9222fb6f08 regex.h (basic_regex<>::assign): Don't lose _M_traits.
2013-08-29  Tim Shen  <timshen91@gmail.com>

	* include/bits/regex.h (basic_regex<>::assign): Don't lose _M_traits.
	  (regex_iterator<>::regex_iterator): Return nullptr when regex_search
	     failed.
	  (regex_token_iterator<>::_M_end_of_seq): Should be defined true when
	    _M_result is(not isn't) nullptr.
	* include/bits/regex_compiler.h: Store _Compiler::_M_traits by reference
	  instead of by value.
	* include/bits/regex_executor.h (_DFSExecutor<>::_DFSExecutor): Add
	  _M_traits to _DFSExecutor.
	* include/bits/regex_executor.tcc (__get_executor<>): Pass traits to
	  _DFSExecutor too.
	* testsuite/28_regex/algorithms/regex_match/extended/wstring_locale.cc:
	  New.
	* testsuite/28_regex/iterators/regex_token_iterator/wchar_t/
	  wstring_02.cc: New.

From-SVN: r202082
2013-08-29 18:33:07 +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 1b488e33b6 regex.h: Executor caller.
2013-08-22  Tim Shen  <timshen91@gmail.com>

	* include/bits/regex.h: Executor caller.
	* include/bits/regex_executor.h: Fix empty grouping problem.
	* include/bits/regex_executor.tcc: Same.
	* testsuite/28_regex/algorithms/regex_match/ecma/cstring_emptygroup.cc:
	  New.

From-SVN: r201914
2013-08-22 00:58:28 +00:00
Phil Muldoon c77efe8f42 re PR libstdc++/53477 (pretty printer fails with: Python Exception <type 'exceptions.IndexError'> list index out of range)
2013-08-20  Phil Muldoon  <pmuldoon@redhat.com>

	PR libstdc++/53477
	http://sourceware.org/bugzilla/show_bug.cgi?id=15195

	* python/libstdcxx/v6/printers.py (Printer.__call__): If a value
	is a reference, fetch referenced value.
	(RxPrinter.invoke): Ditto.
	* testsuite/libstdc++-prettyprinters/cxx11.cc (main): Add -O0
	flag. Add referenced value tests.

From-SVN: r201888
2013-08-20 19:20:42 +00:00
Tim Shen ce645eb091 regex_automaton.h: _S_opcode_backref.
2013-08-18  Tim Shen  <timshen91@gmail.com>

	* include/bits/regex_automaton.h: _S_opcode_backref.
	* include/bits/regex_automaton.tcc: Backref automaton support.
	* include/bits/regex_compiler.tcc: Parsing support.
	* include/bits/regex_executor.h: Add _M_traits for _DFSExecutor.
	* include/bits/regex_executor.tcc: Add _S_opcode_backref support.
	* testsuite/28_regex/algorithms/regex_match/ecma/string_backref.cc: New.

From-SVN: r201825
2013-08-18 13:55:48 +00:00
Paolo Carlini 56b5d3b48b re PR libstdc++/58163 ([C++11] Pedantic assert on str[str.size()] is wrong in C++11)
2013-08-14  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/58163
	* include/bits/basic_string.h (basic_string<>::operator[]): Fix
	_GLIBCXX_DEBUG_PEDASSERT check vs C++11.
	* include/ext/vstring.h: Likewise.
	* testsuite/21_strings/basic_string/element_access/char/58163.cc:
	New.
	* testsuite/21_strings/basic_string/element_access/wchar_t/58163.cc:
	Likewise.
	* testsuite/ext/vstring/element_access/char/58163.cc: Likewise.
	* testsuite/ext/vstring/element_access/wchar_t/58163.cc: Likewise.

From-SVN: r201755
2013-08-15 00:15:12 +00:00
François Dumont b09bcf83e8 hashtable_policy.h (_Hashtable_alloc): New.
2013-08-08  François Dumont  <fdumont@gcc.gnu.org>

	* include/bits/hashtable_policy.h (_Hashtable_alloc): New.
	(_ReuseOrAllocNode, _AllocNode): Adapt to use latter rather than
	_Hashtable.
	(_Before_begin<>): Remove.
	* include/bits/hashtable.h (_Hashtable): Inherit from
	_Hashtable_alloc and adapt. Restore _M_before_begin field.
	* src/c++11/hashtable_c++0x.cc: Add ext/alloc_traits.h include.
	* python/libstdcxx/v6/printers.py (StdHashtableIterator): Adapt
	access to hashtable before begin.
	* testsuite/23_containers/unordered_set/
	not_default_constructible_hash_neg.cc: Adapt dg-error line number.
	* testsuite/23_containers/unordered_set/instantiation_neg.cc:
	Likewise.

From-SVN: r201592
2013-08-08 09:47:29 +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
Paolo Carlini a803975d9c re PR libstdc++/58098 (wrong return value of normal_distribution::min())
2013-08-07  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/58098
	* include/bits/random.h (cauchy_distribution<>::min,
	extreme_value_distribution<>::min, normal_distribution<>::min,
	student_t_distribution<>::min): Fix.
	* include/ext/random (normal_mv_distribution<>::min): Likewise.
	* testsuite/26_numerics/random/cauchy_distribution/cons/parms.cc:
	Adjust.
	testsuite/26_numerics/random/cauchy_distribution/cons/default.cc:
	Likewise.
	* testsuite/26_numerics/random/extreme_value_distribution/cons/
	parms.cc: Likewise.
	testsuite/26_numerics/random/extreme_value_distribution/cons/
	default.cc: Likewise.
	* testsuite/26_numerics/random/normal_distribution/cons/parms.cc:
	Likewise.
	* testsuite/26_numerics/random/normal_distribution/cons/default.cc:
	Likewise.
	* testsuite/26_numerics/random/student_t_distribution/cons/parms.cc:
	Likewise.
	* testsuite/26_numerics/random/student_t_distribution/cons/default.cc:
	Likewise.
	* testsuite/ext/random/normal_mv_distribution/cons/parms.cc: Likewise.
	* testsuite/ext/random/normal_mv_distribution/cons/default.cc: Likewise.

	* testsuite/26_numerics/random/exponential_distribution/cons/parms.cc:
	Minor tweak.
	* testsuite/26_numerics/random/exponential_distribution/cons/default.cc:
	Likewise.

	* testsuite/ext/von_mises_distribution/*: Move to...
	* testsuite/ext/random/von_mises_distribution/*: ... here.
	* testsuite/ext/triangular_distribution/*: Move to...
	* testsuite/ext/random/triangular_distribution/*: ... here.

From-SVN: r201562
2013-08-07 11:41:30 +00:00
Caroline Tice 2077db1be5 Commit the vtable verification feature.
Commit the vtable verification feature.  This feature is designed to
detect, at run time, if/when the vtable pointer in a C++ object has
been corrupted, before allowing virtual calls through that pointer. 
If pointer corruption is detected, execution of the program is halted.

libstdc++-v3 ChangeLog:
2013-08-06  Caroline Tice  <cmtice@google.com>

        * fragment.am: Add XTEMPLATE_FLAGS.
        * configure.ac: Add definitions for --enable-vtable-verify.
        * acinclude.m4:  Add --enable-vtable-verify and
        --disable-vtable-verify; define --enable-vtable-verify; define
        VTV_CXXFLAGS, VTV_PCH_CXXFLAGS and VTV_CXXLINKFLAGS.
        * config/abi/pre/gnu.ver: Export symbols for vtable verification.
        * libsupc++/Makefile.am: Define vtv_sources and add it to
        libsupc___la_SOURCES and libsupc__convenience_la_SOURCES.
        * libsupc++/vtv_stubs.cc: New file.
        * include/Makefile.am: Add VTV_PCH_CXXFLAGS to PCHFLAGS.
        * src/Makefile.am: Add VTV_CXXFLAGS to AM_CXXFLAGS; add
        VTV_CXXLINKFLAGS to CXXLINK.
        * src/c++98/Makefile.am: Comment out XTEMPLATE_FLAGS; add VTV_CXXFLAGS
        to AM_CXXFLAGS; add VTV_CXXXLINKFLAGS to CXXLINK.
        * src/C++11/Makefile.am: Ditto.
        * doc/xml/manual/configure.xml: Add entry for --enable-vtable-verify.
        * scripts/testsuite_flags.in: Add cxxvtvflags to Usage; cause
        cxxvtvflags to use VTV_CXXFLAGS and VTV_CXXLINKFLAGS.
        * testsuite/lib/libstdc++.exp: Add cxxvtvflags; add code to locate
        libvtv if --enable-vtable-verify was used; set cxxvtvflags; add
        cxxvtvflags to cxx_final.
        * testsuite/18_support/bad_exception/23591_thread-1.c: Add
        -fvtable-verify=none to compiler flags.
        * testsuite/17_intro/freestanding.cc: Add -fvtable-verify=none
        to compiler flags.
        * configure: Regenerated.
        * Makefile.in: Regenerated.
        * python/Makefile.in: Regenerated.
        * include/Makefile.in: Regenerated.
        * libsupc++/Makefile.in: Regenerated.
        * config.h.in: Regenerated.
        * po/Makefile.in: Regenerated.
        * src/Makefile.in: Regenerated.
        * src/c++98/Makefile.in: Regenerated.
        * src/c++11/Makefile.in: Regenerated.
        * doc/Makefile.in: Regenerated.
        * testsuite/Makefile.in: Regenerated.

top level ChangeLog:
2013-08-06  Caroline Tice  <cmtice@google.com>

        * configure.ac: Add target-libvtv to target_libraries; disable libvtv
        on non-linux systems; add target-libvtv to noconfigdirs; add
        libsupc++/.libs to C++ library search paths.
        * configure: Regenerated.
        * Makefile.def: Add libvtv to target_modules; make libvtv depend on
        libstdc++ and libgcc.
        * Makefile.in: Regenerated.

include/ChangeLog:
2013-08-06  Caroline Tice  <cmtice@google.com>

        * vtv-change-permission.h: New file.

contrib/ChangeLog:
2013-08-06  Caroline Tice4  <cmtice@google.com>

        * gcc_update: Add libvtv files.

libgcc/ChangeLog:
2013-08-06  Caroline Tice  <cmtice@google.com>

        config.host (extra_parts): Add vtv_start.o, vtv_end.o
        vtv_start_preinit.o and vtv_end_preinit.o.
        configure.ac: Add code to check/set enable_vtable_verify.
        Makefile.in: Add rules to build vtv_*.o, if enable_vtable_verify is
        true.
        vtv_start_preinit.c: New file.
        vtv_end_preinit.c: New file.
        vtv_start.c: New file.
        vtv_end.c: New file.
        configure: Regenerated.

gcc/ChangeLog:
2013-08-06  Caroline Tice  <cmtice@google.com>

        * gcc.c (VTABLE_VERIFICATION_SPEC): New definition.
        (LINK_COMMAND_SPEC): Add VTABLE_VERIFICATION_SPEC.
        * tree-pass.h: Add pass_vtable_verify.
        * varasm.c (assemble_variable): Add code to properly set the comdat
        section and name for the .vtable_map_vars section.
        (assemble_vtyv_preinit_initializer): New function.
        (default_sectin_type_flags):  Make sure .vtable_map_vars section has
        LINK_ONCE flag.
        * output.h: Add function decl for assemble_vtv_preinit_initializer.
        * vtable-verify.c: New file.
        * vtable-verify.h: New file.
        * flag-types.h (enum vtv_priority): Defintions for flag_vtable_verify
        initialiation levels.
        * timevar.def (TV_VTABLE_VERIFICATION): New definition.
        * passes.def: Insert pass_vtable_verify.
        * aclocal.m4: Reorder includes.
        * doc/invoke.texi: Add documentation for the flags -fvtable-verify=,
	-fvtv-debug and -fvtv-counts.
        * config/gnu-user.h (GNU_USER_TARGET_STARTFILE_SPEC): Add vtv_start*.o,
as appropriate, if -fvtable-verify=... is used.
        (GNU_USER_TARGET_ENDFILE_SPEC): Add vtv_end*.o as appropriate, if
        -fvtable-verify=... is used.
        * Makefile.in (OBJS):  Add vtable-verify.o to list.
        (vtable-verify.o): Add new build rule.
        (GTFILES): Add vtable-verify.c to list.
        * common.opt (fvtable-verify=): New flag.
        (vtv_priority): Values for fvtable-verify= flag.
        (fvtv-counts): New flag.
(fvtv-debug): New flag.
        * tree.h (save_vtable_map_decl): New extern function decl.


gcc/cp/ChangeLog:
2013-08-06  Caroline Tice  <cmtice@google.com>

        * Make-lang.in (*CXX_AND_OBJCXX_OBJS):  Add vtable-class-hierarchy.o to
        list.
        (vtable-class-hierarchy.o): Add build rule.
        * cp-tree.h (vtv_start_verification_constructor_init_function): New
        extern function decl.
        (vtv_finish_verification_constructor_init_function): New extern
        function decl.
        (build_vtbl_address): New extern function decl.
        (get_mangled_vtable_map_var_name): New extern function decl.
        (vtv_compute_class_hierarchy_transitive_closure): New extern function
        decl.
        (vtv_generate_init_routine): New extern function decl.
        (vtv_save_class_info): New extern function decl.
        (vtv_recover_class_info): New extern function decl.
        (vtv_build_vtable_verify_fndecl): New extern function decl.
        * class.c (finish_struct_1): Add call to vtv_save_class_info if
        flag_vtable_verify is true.
        * config-lang.in: Add vtable-class-hierarchy.c to gtfiles list.
        * vtable-class-hierarchy.c: New file.
        * mangle.c (get_mangled_vtable_map_var_name):  New function.
        * decl2.c (start_objects): Update function comment.
        (cp_write_global_declarations): Call vtv_recover_class_info,
        vtv_compute_class_hierarchy_transitive_closure and
        vtv_build_vtable_verify_fndecl, before calling
        finalize_compilation_unit, and call vtv_generate_init_rount after, IFF
        flag_vtable_verify is true.
        (vtv_start_verification_constructor_init_function): New function.
        (vtv_finish_verification_constructor_init_function): New function.
        * init.c (build_vtbl_address): Remove static qualifier from function.

libvtv/ChangeLog:
2013-08-06  Caroline Tice  <cmtice@google.com>

        Initial check-in of new vtable verification feature.
        * configure.ac : New file.
        * acinclude.m4 : New file.
        * Makefile.am : New file.
        * aclocal.m4 : New file.
        * configure.tgt : New file.
        * configure: New file (generated).
        * Makefile.in: New file (generated).
        * vtv_set.h : New file.
        * vtv_utils.cc : New file.
        * vtv_utils.h : New file.
        * vtv_malloc.cc : New file.
        * vtv_rts.cc : New file.
        * vtv_malloc.h : New file.
        * vtv_rts.h : New file.
        * vtv_fail.cc : New file.
        * vtv_fail.h : New file.
        * vtv_map.h : New file.
        * scripts/run-testsuite.sh : New file.
        * scripts/sum-vtv-counts.c : New file.
        * testsuite/parts-test-main.h : New file.
        * testusite/dataentry.cc : New file.
        * testsuite/temp_deriv.cc : New file.
        * testsuite/register_pair.cc : New file.
        * testsuite/virtual_inheritance.cc : New file.
        * testsuite/field-test.cc : New file.
        * testsuite/nested_vcall_test.cc : New file.
        * testsuite/template-list-iostream.cc : New file.
        * testsuite/register_pair_inserts.cc : New file.
        * testsuite/register_pair_inserts_mt.cc : New file.
        * testsuite/event.list : New file.
        * testsuite/parts-test-extra-parts-views.cc : New file.
        * testsuite/parts-test-extra-parts-views.h : New file.
        * testsuite/environment-fail-32.s : New file.
        * testsuite/parts-test-extra-parts.h : New file.
        * testsuite/temp_deriv2.cc : New file.
        * testsuite/dlopen_mt.cc : New file.
        * testsuite/event.h : New file.
        * testsuite/template-list.cc : New file.
        * testsuite/replace-fail.cc : New file.
        * testsuite/Makefile.am : New file.
        * testsuite/Makefile.in: New file (generated).
        * testsuite/mempool_negative.c : New file.
        * testsuite/parts-test-main.cc : New file.
        * testsuite/event-private.cc : New file.
        * testsuite/thunk.cc : New file.
        * testsuite/event-defintiions.cc : New file.
        * testsuite/event-private.h : New file.
        * testsuite/parts-test.list : New file.
        * testusite/register_pair_mt.cc : New file.
        * testsuite/povray-derived.cc : New file.
        * testsuite/event-main.cc : New file.
        * testsuite/environment.cc : New file.
        * testsuite/template-list2.cc : New file.
        * testsuite/thunk_vtable_map_attack.cc : New file.
        * testsuite/parts-test-extra-parts.cc : New file.
        * testsuite/environment-fail-64.s : New file.
        * testsuite/dlopen.cc : New file.
        * testsuite/so.cc : New file.
        * testsuite/temp_deriv3.cc : New file.
        * testsuite/const_vtable.cc : New file.
        * testsuite/mempool_positive.c : New file.
        * testsuite/dup_name.cc : New file.

From-SVN: r201555
2013-08-06 20:38:59 -07:00
Paolo Carlini 6ffd1096cf 2013-08-06 Paolo Carlini <paolo.carlini@oracle.com>
Revert the last commit.

From-SVN: r201525
2013-08-06 11:11:07 +00:00
François Dumont a3d4b3d7db hashtable_policy.h (_Hashtable_alloc): New.
2013-08-06  François Dumont  <fdumont@gcc.gnu.org>

	* include/bits/hashtable_policy.h (_Hashtable_alloc): New.
	(_ReuseOrAllocNode, _AllocNode): Adapt to use latter rather than
	_Hashtable.
	(_Before_begin<>): Remove.
	* include/bits/hashtable.h (_Hashtable): Inherit from
	_Hashtable_alloc and adapt. Restore _M_before_begin field.
	* python/libstdcxx/v6/printers.py (StdHashtableIterator): Adapt
	access to hashtable before begin.
	* testsuite/23_containers/unordered_set/
	not_default_constructible_hash_neg.cc: Adapt dg-error line number.
	* testsuite/23_containers/unordered_set/instantiation_neg.cc:
	Likewise.

From-SVN: r201522
2013-08-06 08:38:58 +00:00
Tim Shen 399eeef978 Implement bracket expression.
2013-08-03  Tim Shen  <timshen91@gmail.com>

	Implement bracket expression.
	* include/bits/regex.h: Remove constexpr from "|=", etc.
	* include/bits/regex_compiler.h: Parse bracket expression.
	* include/bits/regex_nfa.h: _Comparator and _BracketMatcher(old
	_RangeMatcher).
	* include/bits/regex_nfa.tcc: Implement them.
	* testsuite/28_regex/algorithms/regex_match/extended/53622.cc:
	from regex_search to regex_match.
	* testsuite/28_regex/algorithms/regex_match/extended/
	cstring_bracket_01.cc: New.

From-SVN: r201465
2013-08-03 14:32:54 +00:00
François Dumont 5720787ada re PR libstdc++/57779 (vector insert fails to diagnose iterators pointing into *this in debug mode)
2013-08-01  François Dumont  <fdumont@gcc.gnu.org>

	PR libstdc++/57779
	* include/debug/formatter.h (_Debug_msg_id): Add
	__msg_insert_itself_range entry.
	* include/debug/functions.h (_Insert_range_from_self_is_safe<>):
	New, indicate container types supporting self range insertion in
	GNU implementation.
	(__foreign_iterator): New, check if an iterator points to a given
	sequence.
	* include/debug/macros.h (__glibcxx_check_insert_range): Add check
	using __foreign_iterator.
	(__gibcxx_check_insert_range_after): Likewise.
	* include/debug/string (_Insert_range_from_self_is_safe<>):
	Partially specialized to mark __gnu_debug::basic_string<> as
	supporting self range insert.
	* include/debug/list (_Insert_range_from_self_is_safe<>):
	Partially specialized to mark std::list as supporting self range
	insert if _GLIBCXX_DEBUG_PEDANTIC is not defined.
	* include/debug/forward_list (_Insert_range_from_self_is_safe<>):
	Likewise.
	* src/c++11/debug.cc (_S_debug_messages): Add
	__msg_insert_itself_range_entry message.
	(_Error_formatter::_Parameter::_M_print_description): Display
	iterator sequence address rather than sequence address when the
	parameter type is an iterator.
	(_Error_formatter::_M_print_word): Enhance behavior when
	displaying a word with an appended '\n'.
	* testsuite/util/debug/checks.h (check_insert4<>): New.
	* testsuite/23_containers/deque/debug/insert5_neg.cc: New.
	* testsuite/23_containers/vector/debug/insert5_neg.cc: Likewise.
	* testsuite/23_containers/vector/debug/insert6_neg.cc: Likewise.
	* testsuite/23_containers/vector/debug/57779_neg.cc: Likewise.
	* testsuite/23_containers/list/debug/insert5_neg.cc: Likewise.
	* testsuite/23_containers/forward_list/debug/insert_after4_neg.cc:
	Likewise.

From-SVN: r201416
2013-08-01 19:54:46 +00:00
Fabien Chêne fb23b69e14 re PR c++/54537 (undiagnosed using-declaration conflicting with used function)
gcc/cp/
        PR c++/54537
        * cp-tree.h: Check OVL_USED with OVERLOAD_CHECK.
        * name-lookup.c (do_nonmember_using_decl): Make sure we have an
	OVERLOAD before calling OVL_USED. Call diagnose_name_conflict
	instead of issuing an error without mentioning the conflicting
	declaration.

libstdc++-v3/
        PR c++/54537
	* include/tr1/cmath: Remove pow(double,double) overload, remove a
	duplicated comment about DR 550. Add a comment to explain the
	issue.
	* testsuite/tr1/8_c_compatibility/cmath/pow_cmath.cc: New.

gcc/testsuite/
        PR c++/54537
        * g++.dg/overload/using3.C: New.
	* g++.dg/overload/using2.C: Adjust.
	* g++.dg/lookup/using9.C: Likewise.

Co-Authored-By: Peter Bergner <bergner@vnet.ibm.com>

From-SVN: r201414
2013-08-01 14:24:37 -05: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
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 9a92fa8b66 2013-07-30 Paolo Carlini <paolo.carlini@oracle.com>
Revert last commit.

From-SVN: r201349
2013-07-30 18:16:33 +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
Tim Shen 105164bb90 Add documents and comments.
2013-07-25  Tim Shen  <timshen91@gmail.com>

	Add documents and comments.
	* include/bits/regex.h: Documents and comments.
	* include/bits/regex_grep_matcher.h: Likewise.
	* include/bits/regex_grep_matcher.tcc: Likewise.
	* testsuite/28_regex/iterators/regex_iterator/char/string_position_01.cc:
	New.

From-SVN: r201244
2013-07-25 14:59:43 +00:00
Tim Shen 37c74e2816 Reimplment matcher using Depth-first search(backtracking).
2013-07-24  Tim Shen  <timshen91@gmail.com>

	Reimplment matcher using Depth-first search(backtracking).
	PR libstdc++/53622
	PR libstdc++/57173
	* include/bits/regex.h: regex_match() and regex_search().
	* include/bits/regex_cursor.h: Fix _M_set_pos().
	* include/bits/regex_grep_matcher.h: add _M_dfs_match().
	* include/bits/regex_grep_matcher.tcc: Implement it.
	* testsuite/28_regex/algorithms/regex_match/extended/string_group_01.cc:
	New.
	* testsuite/28_regex/algorithms/regex_match/extended/string_group_02.cc:
	New.
	* testsuite/28_regex/algorithms/regex_search/basic/string_01.cc:
	Remove xfail.

From-SVN: r201213
2013-07-24 14:39:54 +00:00
Tim Shen 407a0fa3a4 Implement regex_iterator and regex_token_iterator.
2013-07-23  Tim Shen  <timshen91@gmail.com>

	Implement regex_iterator and regex_token_iterator.
	* include/bits/regex.h: regex_iterator and regex_token_iterator.
	* testsuite/28_regex/iterators/regex_iterator/char/string_01.cc:
	New.
	* testsuite/28_regex/iterators/regex_iterator/wchar_t/string_01.cc:
	New.
	* testsuite/28_regex/iterators/regex_token_iterator/char/string_01.cc:
	New.
	* testsuite/28_regex/iterators/regex_token_iterator/wchar_t/string_01.cc:
	New.

From-SVN: r201169
2013-07-23 12:31:51 +00:00
Tim Shen 603c431f90 Partially implement regex_search.
2013-07-21  Tim Shen  <timshen91@gmail.com>

	Partially implement regex_search.
	* include/bits/regex.h: regex_search.
	* include/bits/regex_grep_matcher.h: _M_search_from_first.
	* include/bits/regex_grep_matcher.tcc: Implement it.
	* testsuite/28_regex/algorithms/regex_search/basic/string_01.cc: New.

From-SVN: r201113
2013-07-21 23:34:02 +00:00
Mike Stump d76e725e47 Fix.
From-SVN: r201103
2013-07-21 16:52:00 +00:00
Tim Shen b3ebe3d0e0 Implement class regex_traits.
2013-07-09  Tim Shen  <timshen91@gmail.com>

	Implement class regex_traits.
	* include/bits/regex.h: Implement lookup_classname and
	lookup_collatename; modify isctype; partially implement
	transform_primary.
	* testsuite/28_regex/traits/char/isctype.cc: Add more test cases.
	* testsuite/28_regex/traits/char/lookup_classname.cc: Likewise.
	* testsuite/28_regex/traits/char/lookup_collatename.cc: Likewise.
	* testsuite/28_regex/traits/char/transform_primary.cc: Likewise.
	* testsuite/28_regex/traits/wchar_t/isctype.cc: New.
	* testsuite/28_regex/traits/wchar_t/lookup_classname.cc: New.
	* testsuite/28_regex/traits/wchar_t/lookup_collatename.cc: New.
	* testsuite/28_regex/traits/wchar_t/transform_primary.cc: New.

From-SVN: r200818
2013-07-09 13:41:10 +00:00
François Dumont b3abc9d822 hashtable_policy.h (_ReuseOrAllocNode): Use forward pattern.
2013-07-05  François Dumont  <fdumont@gcc.gnu.org>

	* include/bits/hashtable_policy.h (_ReuseOrAllocNode): Use forward
	pattern.
	(_MoveReuseOrAllocNode): Remove.
	(_Insert_base): Take a functor defining how the node is generated.
	* include/bits/hashtable.h: Adapt.
	(operator=(initializer_list<value_type>)): Reuse node if any.
	* testsuite/23_containers/unordered_set/instantiation_neg.cc:
	Adjust dg-error line number.
	* testsuite/23_containers/unordered_set/
	not_default_constructible_hash_neg.cc: Likewise.

From-SVN: r200724
2013-07-05 21:21:07 +00:00
Paolo Carlini 8b30e1668e const_iterator.cc: Tweak, avoid potential undefined behavior.
2013-07-05  Paolo Carlini  <paolo.carlini@oracle.com>

	* testsuite/23_containers/deque/modifiers/insert/const_iterator.cc:
	Tweak, avoid potential undefined behavior.
	* testsuite/23_containers/list/modifiers/insert/const_iterator.cc:
	Likewise.
	* testsuite/23_containers/vector/bool/modifiers/insert/
	const_iterator.cc: Likewise.
	* testsuite/23_containers/vector/modifiers/insert/const_iterator.cc:
	Likewise.

From-SVN: r200703
2013-07-05 10:32:20 +00:00
Veres Lajos 1d77bc548a codecvt_members.cc: Fix typo.
2013-07-04  Veres Lajos  <vlajos@gmail.com>
	    Jonathan Wakely  <jwakely.gcc@gmail.com>

	* config/locale/generic/codecvt_members.cc: Fix typo.
	* configure.host: Likewise.
	* doc/html/manual/policy_data_structures_design.html: Likewise.
	* doc/xml/manual/policy_data_structures.xml: Likewise.
	* include/bits/hashtable.h: Likewise.
	* include/bits/random.h: Likewise.
	* include/profile/impl/profiler_trace.h: Likewise.
	* testsuite/23_containers/deque/cons/2.cc: Likewise.
	* testsuite/23_containers/deque/debug/shrink_to_fit.cc: Likewise.
	* testsuite/ext/pb_ds/example/basic_multimap.cc: Likewise.
	* testsuite/performance/23_containers/insert_erase/41975.cc: Likewise.

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

From-SVN: r200681
2013-07-04 22:07:44 +01:00
Paolo Carlini 019fdb7923 stl_list.h (list<>::insert(iterator, size_type, const value_type&), [...]): Adjust C++11 signatures to take const_iterator(s).
2013-07-01  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/bits/stl_list.h (list<>::insert(iterator,
	size_type, const value_type&), list<>::insert(iterator,
	initializer_list<>), list<>::insert(iterator, _InputIterator,
	_InputIterator), list<>::splice(iterator, list&&),
	list<>::splice(iterator, list&), list<>::splice(iterator, list&&,
	iterator), list<>::splice(iterator, list&, iterator),
	list<>::splice(iterator, list&&, iterator, iterator),
	list<>::splice(iterator, list&, iterator, iterator)): Adjust C++11
	signatures to take const_iterator(s).
	* include/bits/list.tcc (list<>::insert(const_iterator, size_type,
	const value_type&), list<>::insert(const_iterator, _InputIterator,
	_InputIterator)): Define.
	* include/ext/vstring.h (__versa_string<>::insert(iterator,
	size_type, _CharT), __versa_string<>::insert(iterator,
	_InputIterator, _InputIterator), __versa_string<>::insert(iterator,
	std::initializer_list<>), __versa_string<>::replace(iterator,
	iterator, _InputIterator, _InputIterator), __versa_string<>::
	replace(iterator, iterator, std::initializer_list<>)): Adjust C++11
	signatures to take const_iterator(s).
	(__versa_string<>::_M_replace_dispatch): Take const_iterators.
	* include/ext/vstring.tcc: Likewise.
	* include/debug/list: Adjust.
	* include/profile/list: Likewise.
	* testsuite/23_containers/list/operations/splice/const_iterator.cc:
	New.
	* testsuite/23_containers/list/modifiers/insert/const_iterator.cc:
	Extend.
	* testsuite/ext/vstring/modifiers/insert/char/const_iterator.cc:
	Likewise.
	* testsuite/ext/vstring/modifiers/insert/wchar_t/const_iterator.cc:
	Likewise.
	* testsuite/ext/vstring/modifiers/replace/char/const_iterator.cc:
	Likewise.
	* testsuite/ext/vstring/modifiers/replace/wchar_t/const_iterator.cc:
	Likewise.

	* testsuite/23_containers/list/requirements/dr438/assign_neg.cc:
	Adjust dg-error line number.
	* testsuite/23_containers/list/requirements/dr438/
	constructor_1_neg.cc: Likewise.
	* testsuite/23_containers/list/requirements/dr438/
	constructor_2_neg.cc: Likewise.
	* testsuite/23_containers/list/requirements/dr438/insert_neg.cc:
	Likewise.

From-SVN: r200580
2013-07-01 16:17:46 +00:00
Paolo Carlini 06eed9f588 stl_deque.h (deque<>::insert(iterator, size_type, const value_type&), [...]): Adjust C++11 signatures to take a const_iterator.
2013-06-30  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/bits/stl_deque.h (deque<>::insert(iterator,
	size_type, const value_type&), deque<>::insert(iterator,
	initializer_list<>), deque<>::insert(iterator, _InputIterator,
	_InputIterator)): Adjust C++11 signatures to take a const_iterator.
	* include/bits/stl_vector.h: Likewise.
	* include/bits/stl_bvector.h: Likewise.
	* include/debug/deque: Adjust.
	* include/debug/vector: Likewise.
	* include/profile/deque: Likewise.
	* include/profile/vector: Likewise.
	* testsuite/23_containers/deque/modifiers/insert/const_iterator.cc:
	Extend.
	* testsuite/23_containers/vector/bool/modifiers/insert/
	const_iterator.cc: Likewise.
	* testsuite/23_containers/vector/modifiers/insert/const_iterator.cc:
	Likewise.

	* testsuite/23_containers/deque/requirements/dr438/assign_neg.cc:
	Adjust dg-error line number.
	* 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/deque/requirements/dr438/insert_neg.cc:
	Likewise.
	* testsuite/23_containers/vector/requirements/dr438/assign_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/vector/requirements/dr438/insert_neg.cc:
	Likewise.

From-SVN: r200571
2013-06-30 16:24:30 +00:00
François Dumont 41349aec29 hashtable_policy.h (_Insert_base): Consider hint in insert methods.
2013-06-29  François Dumont  <fdumont@gcc.gnu.org>

	* include/bits/hashtable_policy.h (_Insert_base): Consider hint in
	insert methods.
	* include/bits/hashtable.h: Likewise.
	* testsuite/23_containers/unordered_multimap/insert/hint.cc: New.
	* testsuite/performance/23_containers/insert/unordered_multiset_hint.cc:
	New.
	* testsuite/23_containers/unordered_set/instantiation_neg.cc:
	Adjust dg-error line number.
	* testsuite/23_containers/unordered_set/
	not_default_constructible_hash_neg.cc: Likewise.
	* doc/xml/manual/containers.xml: Document hinting in unordered
	containers.

From-SVN: r200564
2013-06-29 07:55:12 +00:00
Paolo Carlini 7d9800e39a *: Move inside testsuite/21_strings/basic_string/operations/data/.
2013-06-27  Paolo Carlini  <paolo.carlini@oracle.com>

	* testsuite/21_strings/basic_string/operations/*: Move inside
	testsuite/21_strings/basic_string/operations/data/.
	* testsuite/21_strings/basic_string/compare/*: Move inside
	testsuite/21_strings/basic_string/operations/.
	* testsuite/21_strings/basic_string/find/*: Likewise.
	* testsuite/21_strings/basic_string/rfind/*: Likewise.
	* testsuite/21_strings/basic_string/substr/*: Likewise.

From-SVN: r200537
2013-06-28 16:01:08 +00:00
Paolo Carlini 17ee10dbec *: Move inside testsuite/21_strings/basic_string/modifiers/.
2013-06-27  Paolo Carlini  <paolo.carlini@oracle.com>

	* testsuite/21_strings/basic_string/append/*: Move inside
	testsuite/21_strings/basic_string/modifiers/.
	* testsuite/21_strings/basic_string/assign/*: Likewise.
	* testsuite/21_strings/basic_string/insert/*: Likewise.
	* testsuite/21_strings/basic_string/replace/*: Likewise.
	* testsuite/21_strings/basic_string/modifiers/pop_back/char/
	pop_back.cc: Rename to 1.cc.
	* testsuite/21_strings/basic_string/modifiers/pop_back/wchar_t/
	pop_back.cc: Likewise.
	* testsuite/ext/vstring/assign/*: Move inside
	testsuite/ext/vstring/modifiers/.

From-SVN: r200465
2013-06-27 12:15:34 +00:00
Paolo Carlini 7b61c5a9cb stl_deque.h (deque<>::insert(iterator, const value_type&), [...]): Adjust C++11 signatures to take a const_iterator.
2013-06-27  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/bits/stl_deque.h (deque<>::insert(iterator,
	const value_type&), deque<>::insert(iterator, value_type&&),
	deque<>::emplace(iterator, _Args&&...)): Adjust C++11 signatures to
	take a const_iterator.
	(deque<>::erase): Simplify.
	* include/bits/stl_list.h: Likewise.
	(_List_iterator<>::_M_const_cast): Add.
	* include/bits/stl_vector.h: Likewise.
	* include/bits/stl_bvector.h: Likewise.
	(_Bit_iterator::_M_const_cast): Add.
	* include/bits/deque.tcc: Adjust definitions.
	* include/bits/list.tcc: Likewise.
	* include/bits/vector.tcc: Likewise.
	* include/bits/stl_iterator.h (__normal_iterator<>::_M_const_cast):
	Define trivial version in C++98 mode.
	* include/ext/vstring.h (__versa_string<>::insert(iterator, _CharT),
	__versa_string<>::replace(iterator, iterator, const __versa_string&),
	__versa_string<>::replace(iterator, iterator, const _CharT*,
	size_type), __versa_string<>::replace(iterator, iterator,
	const _CharT*), __versa_string<>::replace(iterator, iterator,
	size_type, _CharT)): Adjust C++11 signatures to take a pair of
	const_iterators.
	* include/debug/deque: Adjust.
	* include/debug/list: Likewise.
	* include/debug/vector: Likewise.
	* include/profile/deque: Likewise.
	* include/profile/list: Likewise.
	* include/profile/vector: Likewise.
	(vector<>::emplace): Add.
	* testsuite/util/exception/safety.h: Update.
	* testsuite/23_containers/deque/modifiers/emplace/const_iterator.cc:
	New.
	* testsuite/23_containers/deque/modifiers/insert/const_iterator.cc:
	Likewise.
	* testsuite/23_containers/list/modifiers/emplace/const_iterator.cc:
	Likewise.
	* testsuite/23_containers/list/modifiers/insert/const_iterator.cc:
	Likewise.
	* testsuite/23_containers/vector/bool/modifiers/insert/
	const_iterator.cc: Likewise.
	* testsuite/23_containers/vector/modifiers/emplace/const_iterator.cc:
	Likewise.
	* testsuite/23_containers/vector/modifiers/insert/const_iterator.cc:
	Likewise.
	* testsuite/ext/vstring/modifiers/insert/char/const_iterator.cc:
	Likewise.
	* testsuite/ext/vstring/modifiers/insert/wchar_t/const_iterator.cc:
	Likewise.
	* testsuite/ext/vstring/modifiers/replace/char/const_iterator.cc:
	Likewise.
	* testsuite/ext/vstring/modifiers/replace/wchar_t/const_iterator.cc:
	Likewise.

	* testsuite/ext/vstring/modifiers/char/54577.cc: Move to testsuite/
	ext/vstring/modifiers/erase/char/.
	* testsuite/ext/vstring/modifiers/wchar_t/54577.cc: Move to testsuite/
	ext/vstring/modifiers/wchar_t/.
	* testsuite/ext/vstring/modifiers/char/pop_back.cc: Move to testsuite/
	ext/vstring/modifiers/pop_back/char/.
	* testsuite/ext/vstring/modifiers/wchar_t/pop_back.cc: Move to
	testsuite/ext/vstring/modifiers/pop_back/wchar_t/.

	* testsuite/23_containers/deque/requirements/dr438/assign_neg.cc:
	Adjust dg-error line number.
	* 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/deque/requirements/dr438/insert_neg.cc:
	Likewise.
	* testsuite/23_containers/list/requirements/dr438/assign_neg.cc:
	Likewise.
	* testsuite/23_containers/list/requirements/dr438/
	constructor_1_neg.cc: Likewise.
	* testsuite/23_containers/list/requirements/dr438/
	constructor_2_neg.cc: Likewise.
	* testsuite/23_containers/list/requirements/dr438/insert_neg.cc:
	Likewise.
	* testsuite/23_containers/vector/requirements/dr438/assign_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/vector/requirements/dr438/insert_neg.cc:
	Likewise.

From-SVN: r200458
2013-06-27 09:51:21 +00:00
Jason Merrill 46812ec24c typeck2.c (store_init_value): Diagnose a non-constant initializer for in-class static.
* typeck2.c (store_init_value): Diagnose a non-constant
	initializer for in-class static.

From-SVN: r200450
2013-06-26 22:35:46 -04:00
Paolo Carlini be768ae0fb abi_tag.cc: Avoid spurious fails with check-debug.
2013-06-25  Paolo Carlini  <paolo.carlini@oracle.com>

	* testsuite/23_containers/map/modifiers/erase/abi_tag.cc: Avoid
	spurious fails with check-debug.
	* testsuite/23_containers/multimap/modifiers/erase/abi_tag.cc:
	Likewise.
	* testsuite/23_containers/set/modifiers/erase/abi_tag.cc: Likewise.
	* testsuite/23_containers/multiset/modifiers/erase/abi_tag.cc:
	Likewise.

From-SVN: r200411
2013-06-26 00:29:40 +00:00
Paolo Carlini 6cdbb7e8a1 re PR libstdc++/57704 (std::char_traits<char>::lt is not standards-compliant)
2013-06-25  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/57704
	* include/bits/char_traits.h (char_traits<char>::lt): Implement
	LWG 467.
	* testsuite/21_strings/char_traits/requirements/char/57704.cc: New.

From-SVN: r200392
2013-06-25 08:39:31 +00:00
Paolo Carlini 07bba3b144 re PR libstdc++/57674 (wrong distribution for std::binomial_distribution::operator()(g,param))
2013-06-22  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/57674
	* include/bits/random.h (binomial_distribution<>::_M_waiting):
	Add double parameter.
	* include/bits/random.tcc (binomial_distribution<>::operator()
	(_UniformRandomNumberGenerator&, const param_type&)): Pass
	__param._M_q to _M_waiting.
	(_M_waiting): Adjust.
	* testsuite/26_numerics/random/binomial_distribution/
	operators/values.cc: Add tests.

From-SVN: r200341
2013-06-22 21:07:02 +00:00
Paolo Carlini b0ad3635b6 re PR libstdc++/57666 (valarray<T>::operator= in c++11 mode does not adapt to size)
2013-06-21  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/57666
	* include/std/valarray (valarray<>::operator=(const _Expr<>&)):
	Implement correctly C++11 26.6.2.3/1.
	* testsuite/26_numerics/valarray/dr630-3.C: New.

From-SVN: r200305
2013-06-21 14:23:15 +00:00
Jonathan Wakely 25e00ab674 re PR libstdc++/57641 (std::timed_mutex.try_lock_until() is broken)
PR libstdc++/57641
	* include/std/mutex (timed_mutex, recursive_timed_mutex): Move common
	functionality to new __timed_mutex_impl mixin. Overload try_lock_until
	to handle conversion between different clocks. Replace constrained
	__try_lock_for_impl overloads with conditional increment.
	* include/std/shared_mutex (shared_mutex::_Mutex): Use the new mixin.
	* testsuite/30_threads/timed_mutex/try_lock_until/57641.cc: New.

From-SVN: r200180
2013-06-18 23:55:02 +01:00
Jonathan Wakely f038f5824b re PR libstdc++/57263 (std::set with user-defined allocator - compile error)
PR libstdc++/57263
	* include/bits/forward_list.h (_Fwd_list_base): Convert to/from
	allocator's pointer type.
	* include/bits/hashtable.h (_Hashtable): Likewise.
	* testsuite/util/testsuite_allocator.h (CustomPointerAlloc): Add.
	* testsuite/23_containers/forward_list/allocator/ext_ptr.cc: New.
	* testsuite/23_containers/unordered_set/allocator/ext_ptr.cc: New.
	* testsuite/23_containers/vector/allocator/ext_ptr.cc: New.

From-SVN: r200136
2013-06-16 18:13:34 +01:00