Commit Graph

8077 Commits

Author SHA1 Message Date
H.J. Lu 39aeb94e3d Update x32 baseline_symbols.txt
* config/abi/post/x86_64-linux-gnu/x32/baseline_symbols.txt: Update.

From-SVN: r203456
2013-10-11 11:46:22 -07: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
Oleg Endo c3ddbdce59 re PR libstdc++/58625 (std::signbit always converts to double)
2013-10-06  Oleg Endo  <olegendo@gcc.gnu.org>
	    Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/58625
	* include/c_global/cmath (signbit): Use __builtin_signbitf and
	__builtin_signbitl.

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

From-SVN: r203228
2013-10-06 13:44:47 +00:00
Tim Shen 468146e0b5 regex_executor.tcc (_DFSExecutor<>::_M_dfs): Fix wrong backup variable initialization.
2013-10-03  Tim Shen  <timshen91@gmail.com>

	* include/bits/regex_executor.tcc (_DFSExecutor<>::_M_dfs): Fix wrong
	backup variable initialization.

From-SVN: r203190
2013-10-03 20:54:01 +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
Marc Glisse fc7657bb38 del_op.cc (operator delete): Don't test for 0 before free.
2013-10-03  Marc Glisse  <marc.glisse@inria.fr>

	* libsupc++/del_op.cc (operator delete): Don't test for 0 before free.
	* libsupc++/del_opnt.cc (free): Only declare if freestanding.
	(operator delete): Qualify free with std::.

From-SVN: r203164
2013-10-03 16:16:40 +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 c877c34248 status_cxx2011.xml: Change "is not implemented" to "is not correctly implemented".
2013-10-01  Tim Shen  <timshen91@gmail.com>

	* doc/xml/manual/status_cxx2011.xml: Change "is not implemented" to
	"is not correctly implemented".

From-SVN: r203097
2013-10-01 23:56:45 +00:00
Tim Shen 7d48a109d3 status_cxx2011.xml: Update regex status.
2013-10-01  Tim Shen  <timshen91@gmail.com>

	* doc/xml/manual/status_cxx2011.xml: Update regex status.
	* include/bits/regex.h (match_results<>::begin,
	match_results<>::cbegin, match_results<>::end, match_results<>::cend):
	[28.10.3.13], [28.10.3.14] Always iterate the range [0, size()-2).

From-SVN: r203096
2013-10-01 23:44:04 +00:00
François Dumont 089ccc04e4 algobase.h (mismatch, equal): Provide parallel version for N3671 overloads.
2013-10-01  François Dumont  <fdumont@gcc.gnu.org>

	* include/parallel/algobase.h (mismatch, equal): Provide parallel
	version for N3671 overloads.

From-SVN: r203082
2013-10-01 19:35:01 +00:00
Paul Pluzhnikov 4167a189f6 Fix build break when configured with --enable-symvers=gnu-versioned-namespace
2013-10-01  Paul Pluzhnikov  <ppluzhnikov@google.com>

	* src/c++11/snprintf_lite.cc: Add missing
	_GLIBCXX_{BEGIN,END}_NAMESPACE_VERSION

From-SVN: r203076
2013-10-01 11:20:36 -07:00
Joern Rennecke 53426f6c14 Configuration bits for ARC port:
toplevel:

2013-02-25  Simon Cook  <simon.cook@embecosm.com>

        Changes to build configuration to allow big endian ARC ELF toolchain
        * configure.ac: Also add target-libgloss to noconfigdirs for arceb-*-*.
        * configure: Regenerate.

gcc:

2013-04-03  Joern Rennecke  <joern.rennecke@embecosm.com>
            Brendan Kehoe  <brendan@zen.org>
            Simon Cook  <simon.cook@embecosm.com>

         * config.gcc (arc*-*-elf*, arc*-*-linux-uclibc*): New configurations.

libstdc++-v3:

2012-08-16  Joern Rennecke  <joern.rennecke@embecosm.com>

        * acinclude.m4 (GLIBCXX_ENABLE_SJLJ_EXCEPTIONS): Also check for
        _Unwind_SjLj_Register when deciding if to set enable_sjlj_exceptions.
        * configure: Regenerate.

contrib:

2013-09-05  Joern Rennecke  <joern.rennecke@embecosm.com>

        * config-list.mk: Add arc configurations.

From-SVN: r203070
2013-10-01 17:34:40 +01: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
Paolo Carlini a52906946a algo.h (__find_switch): Use __binder2nd.
2013-09-30  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/parallel/algo.h (__find_switch): Use __binder2nd.

From-SVN: r203040
2013-09-30 19:17:07 +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
François Dumont 3bd2644c00 stl_algo.h (remove_copy, [...]): Declare inline.
2013-09-28  François Dumont  <fdumont@gcc.gnu.org>

	* include/bits/stl_algo.h (remove_copy, remove_copy_if): Declare
	inline.
	(rotate_copy, stable_partition, partial_sort_copy): Likewise.
	(lower_bound, upper_bound, equal_range, inplace_merge): Likewise.
	(includes, next_permutation, prev_permutation): Likewise.
	(replace_copy, replace_copy_if, is_sorted_until): Likewise.
	(minmax_element, is_permutation, adjacent_find): Likewise.
	(count, count_if, search, search_n, merge): Likewise.
	(set_intersection, set_difference): Likewise.
	(set_symmetric_difference, min_element, max_element): Likewise.
	* include/bits/stl_algobase.h (lower_bound): Likewise.
	(lexicographical_compare, mismatch): Likewise.

From-SVN: r203008
2013-09-28 20:30:51 +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
Marc Glisse 34e6625aa2 re PR libstdc++/58338 (Add noexcept to functions with a narrow contract)
2013-09-25  Marc Glisse  <marc.glisse@inria.fr>

	PR libstdc++/58338
	* include/bits/forward_list.h (_Fwd_list_node_base::_M_transfer_after):
	Mark as noexcept.
	(_Fwd_list_iterator) [_Fwd_list_iterator, operator*, operator->,
	operator++, operator==, operator!=, _M_next]: Likewise.
	(_Fwd_list_const_iterator) [_Fwd_list_const_iterator, operator*,
	operator->, operator++, operator==, operator!=, _M_next]: Likewise.
	(operator==(const _Fwd_list_iterator&, const _Fwd_list_const_iterator&),
	operator!=(const _Fwd_list_iterator&, const _Fwd_list_const_iterator&)):
	Likewise.
	* include/bits/hashtable_policy.h (_Hash_node_base::_Hash_node_base,
	_Hash_node::_M_next, _Node_iterator_base::_Node_iterator_base,
	_Node_iterator_base::_M_incr, operator==(const _Node_iterator_base&,
	const _Node_iterator_base&), operator!=(const _Node_iterator_base&,
	const _Node_iterator_base&)): Likewise.
	(_Node_iterator) [_Node_iterator, operator*, operator->, operator++]:
	Likewise.
	(_Node_const_iterator) [_Node_const_iterator, operator*, operator->,
	operator++]: Likewise.
	* include/debug/safe_iterator.h (_Safe_iterator) [_Safe_iterator,
	operator=, operator*, operator->, operator++, operator--, operator[],
	operator+=, operator+, operator-=, operator-, base, operator _Iterator]:
	Likewise.
	(operator==(const _Safe_iterator&, const _Safe_iterator&),
	operator!=(const _Safe_iterator&, const _Safe_iterator&),
	operator<(const _Safe_iterator&, const _Safe_iterator&),
	operator<=(const _Safe_iterator&, const _Safe_iterator&),
	operator>(const _Safe_iterator&, const _Safe_iterator&),
	operator>=(const _Safe_iterator&, const _Safe_iterator&),
	operator-(const _Safe_iterator&, const _Safe_iterator&),
	operator+(difference_type, const _Safe_iterator&)): Likewise.
	* include/profile/iterator_tracker.h (__iterator_tracker)
	[__iterator_tracker, base, operator _Iterator, operator->, operator++,
	operator--, operator=, operator*, operator[], operator+=, operator+,
	operator-=, operator-]: Likewise.
	(operator==(const __iterator_tracker&, const __iterator_tracker&),
	operator!=(const __iterator_tracker&, const __iterator_tracker&),
	operator<(const __iterator_tracker&, const __iterator_tracker&),
	operator<=(const __iterator_tracker&, const __iterator_tracker&),
	operator>(const __iterator_tracker&, const __iterator_tracker&),
	operator>=(const __iterator_tracker&, const __iterator_tracker&),
	operator-(const __iterator_tracker&, const __iterator_tracker&),
	operator+(difference_type, const __iterator_tracker&)): Likewise.

From-SVN: r202924
2013-09-25 20:28:12 +00:00
Marc Glisse 63ebd8f129 re PR libstdc++/58338 (Add noexcept to functions with a narrow contract)
2013-09-24  Marc Glisse  <marc.glisse@inria.fr>

	PR libstdc++/58338
	PR libstdc++/56166
	* include/bits/basic_string.h (basic_string)
	[basic_string(basic_string&&)]: Make the noexcept conditional.
	[operator=(basic_string&&), assign(basic_string&&)]: Link to PR 58265.
	[begin(), end(), rbegin(), rend(), clear]: Remove noexcept.
	[pop_back]: Comment on the lack of noexcept.
	* include/debug/string (basic_string) [basic_string(const _Allocator&),
	basic_string(basic_string&&), begin(), end(), rbegin(), rend(), clear,
	operator[](size_type), pop_back]: Comment out noexcept, until vstring
	replaces basic_string.

From-SVN: r202861
2013-09-24 10:07:32 +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 dfff7c4692 snprintf_lite.cc (__concat_size_t): Use unsigned long long conditionally.
2013-09-23  Paul Pluzhnikov  <ppluzhnikov@google.com>

	* src/c++11/snprintf_lite.cc (__concat_size_t): Use
	unsigned long long conditionally.

From-SVN: r202836
2013-09-23 09:36:11 -07:00
Paul Pluzhnikov 5303f3a48f Unbreak i386 and other builds where size_t != unsigned long.
2013-09-23  Paul Pluzhnikov  <ppluzhnikov@google.com>

	* src/c++11/snprintf_lite.cc (__concat_size_t): Use only
	std::__int_to_char<unsigned long long>()

From-SVN: r202832
2013-09-23 08:29:14 -07: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
Alan Modra 3cbe17f7de libtool.m4 (_LT_ENABLE_LOCK <ld -m flags>): Remove non-canonical ppc host match.
* libtool.m4 (_LT_ENABLE_LOCK <ld -m flags>): Remove non-canonical
	ppc host match.  Support little-endian powerpc linux hosts.
Regenerate configure throughout.

From-SVN: r202773
2013-09-20 19:17:52 +09:30
Marc Glisse 0e1a966a86 re PR libstdc++/58338 (Add noexcept to functions with a narrow contract)
2013-09-19  Marc Glisse  <marc.glisse@inria.fr>

	PR libstdc++/58338
	* include/bits/stl_tree.h (_Rb_tree_node_base) [_S_minimum, _S_maximum]:
	Mark as noexcept.
	(_Rb_tree_iterator) [_Rb_tree_iterator, operator*, operator->,
	operator++, operator--, operator==, operator!=]: Likewise.
	(_Rb_tree_const_iterator) [_Rb_tree_const_iterator, _M_const_cast,
	operator*, operator->, operator++, operator--, operator==, operator!=]:
	Likewise.
	(operator==(const _Rb_tree_iterator&, const _Rb_tree_const_iterator&),
	operator!=(const _Rb_tree_iterator&, const _Rb_tree_const_iterator&)):
	Likewise.
	(_Rb_tree) [_M_put_node, _M_destroy_node, _M_root, _M_leftmost,
	_M_rightmost, _M_begin, _M_end, _S_left, _S_right, _S_minimum,
	_S_maximum]: Likewise.
	* include/debug/string (basic_string) [basic_string(const _Allocator&),
	shrink_to_fit, operator[], pop_back]: Likewise.
	* include/ext/vstring.h (__versa_string) [_M_limit, _M_disjunct,
	_M_ibegin, _M_iend, __versa_string(const _Alloc&),
	operator=(__versa_string&&), shrink_to_fit, operator[], front,
	back, assign(__versa_string&&), swap]: Likewise.
	(__versa_string) [__versa_string(), __versa_string(const _Alloc&)]:
	Merge.

From-SVN: r202737
2013-09-19 11:40:29 +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
Kai Tietz 1329f0c4e2 Add PR's section
From-SVN: r202473
2013-09-10 18:18:34 +02:00
Kai Tietz 6da10826b2 gnu-versioned-namespace.ver: Add thunk _ZTv0_n12_NS* like in gnu.ver.
PR/54314
	* config/abi/pre/gnu-versioned-namespace.ver: Add thunk _ZTv0_n12_NS*
	like in gnu.ver.

From-SVN: r202472
2013-09-10 18:17:25 +02:00