Commit Graph

3160 Commits

Author SHA1 Message Date
Jason Merrill 839473d010 synopsis.cc: Add _GLIBCXX14_CONSTEXPR.
* testsuite/20_util/headers/functional/synopsis.cc: Add
	_GLIBCXX14_CONSTEXPR.
	* testsuite/25_algorithms/headers/algorithm/synopsis.cc: Likewise.

From-SVN: r222975
2015-05-09 20:46:12 -04:00
Jason Merrill f8356d52f2 std_c++0x_neg.cc: Add -std=c++98.
* testsuite/19_diagnostics/headers/system_error/std_c++0x_neg.cc: Add -std=c++98.
	* testsuite/20_util/auto_ptr/1.cc: Add -std=c++98.
	* testsuite/20_util/auto_ptr/2.cc: Add -std=c++98.
	* testsuite/20_util/auto_ptr/3.cc: Add -std=c++98.
	* testsuite/20_util/auto_ptr/4.cc: Add -std=c++98.
	* testsuite/20_util/auto_ptr/5.cc: Add -std=c++98.
	* testsuite/20_util/auto_ptr/6.cc: Add -std=c++98.
	* testsuite/20_util/auto_ptr/7.cc: Add -std=c++98.
	* testsuite/20_util/auto_ptr/3946.cc: Add -std=c++98.
	* testsuite/20_util/auto_ptr/assign_neg.cc: Add -std=c++98.
	* testsuite/20_util/auto_ptr/requirements/explicit_instantiation/1.cc: Likewise.
	* testsuite/20_util/headers/functional/synopsis.cc: Add -Wno-deprecated.
	* testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust expected errors.
	* 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.
	* testsuite/ext/array_allocator/1.cc: Add -Wno-deprecated.
	* testsuite/ext/array_allocator/2.cc: Add -Wno-deprecated.
	* testsuite/ext/array_allocator/26875.cc: Add -Wno-deprecated.
	* testsuite/ext/array_allocator/3.cc: Add -Wno-deprecated.
	* testsuite/ext/array_allocator/check_allocate_max_size.cc: Add -Wno-deprecated.
	* testsuite/ext/array_allocator/check_deallocate_null.cc: Add -Wno-deprecated.
	* testsuite/ext/array_allocator/check_delete.cc: Add -Wno-deprecated.
	* testsuite/ext/array_allocator/check_new.cc: Add -Wno-deprecated.
	* testsuite/ext/profile/mutex_extensions_neg.cc: Prune follow-on error.
	* testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr.cc: Add -std=c++98.
	* testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr_neg.cc: Add -std=c++98.
	* testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr_rvalue_neg.cc: Add -std=c++98.
	* testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc: Add -std=c++98 -fno-show-column.
	* testsuite/tr1/2_general_utilities/shared_ptr/cons/auto_ptr.cc: Add -std=c++98.
	* testsuite/tr1/2_general_utilities/shared_ptr/cons/auto_ptr_neg.cc: Add -std=c++98.
	* testsuite/tr1/6_containers/utility/pair.cc: Add -std=c++98.
	* testsuite/tr1/8_c_compatibility/cmath/pow_cmath.cc: Add -std=c++98.

From-SVN: r222965
2015-05-09 00:50:30 -04:00
Jason Merrill 8243e2a9d0 c.opt (Wterminate): New.
gcc/c-family/
	* c.opt (Wterminate): New.
gcc/cp/
	* cp-gimplify.c (cp_genericize_r): Track TRY_BLOCK and
	MUST_NOT_THROW_EXPR, warn about a THROW_EXPR directly within a
	MUST_NOT_THROW_EXPR.
	(cp_genericize_data): Add try_block field.
	(cp_genericize_tree): Initialize it.
	* except.c (expand_end_catch_block): Set TREE_NO_WARNING on
	implicit rethrow.

From-SVN: r222842
2015-05-05 22:25:01 -04:00
Jonathan Wakely 563777d7fc any (any::_Storage): Fix alignment of buffer.
* include/experimental/any (any::_Storage): Fix alignment of buffer.
	(any::_Internal): Check alignment of type.
	* testsuite/experimental/any/cons/aligned.cc: New.
	* testsuite/experimental/any/misc/any_cast_neg.cc: Adjust dg-error.

From-SVN: r222729
2015-05-02 19:19:39 +01:00
Jonathan Wakely a623b6f011 iterator: New.
* include/experimental/iterator: New. Define ostream_joiner.
	* include/Makefile.am: Add new header.
	* include/Makefile.in: Regenerate.
	* testsuite/experimental/iterator/make_ostream_joiner.cc: New.
	* testsuite/experimental/iterator/ostream_joiner.cc: New.
	* testsuite/experimental/iterator/requirements.cc: New.
	* doc/xml/manual/status_cxx2017.xml: Update status.
	* doc/html/manual/status.html: Regenerate.

From-SVN: r222727
2015-05-02 18:14:25 +01:00
Jonathan Wakely 6c0b8a537c numeric: New.
* include/experimental/numeric: New. Define gcd and lcm.
	* include/Makefile.am: Add new header.
	* include/Makefile.in: Regenerate.
	* testsuite/experimental/numeric/gcd.cc: New.
	* testsuite/experimental/numeric/lcm.cc: New.
	* doc/xml/manual/status_cxx2017.xml: Update status.
	* doc/html/manual/status.html: Regenerate.

From-SVN: r222724
2015-05-02 16:18:36 +01:00
Jonathan Wakely 9407c6fa53 any (any::_Storage): Make non-copyable.
* include/experimental/any (any::_Storage): Make non-copyable.
	(any::any): Do not copy _Storage object.
	(any::operator=): Implement more efficiently than swapping.
	(any::swap): Use new _Op_xfer operation.
	(any::_Op::_Op_xfer): New enumerator.
	(_Manager_internal::_S_alloc): Remove unused function.
	(_Manager_internal::_S_create, _Manager_external::_S_create): Use out
	parameter instead of returning a _Storage object.
	(_Manager_internal::_S_manage, _Manager_external::_S_manage): Add
	_Op_xfer operation for moving and swapping.
	* testsuite/experimental/any/cons/nontrivial.cc: New.
	* testsuite/experimental/any/misc/any_cast_neg.cc: Adjust dg-error.

From-SVN: r222721
2015-05-02 13:38:44 +01:00
Jonathan Wakely cb2ef49e83 re PR libstdc++/65978 (missing constexpr on std::forward_as_tuple and std::tie (LWG issues 2275 and 2301))
PR libstdc++/65978
	* include/std/tuple (forward_as_tuple, tie): Add constexpr.
	* testsuite/20_util/tuple/creation_functions/constexpr.cc: Uncomment
	and fix tests for forward_as_tuple and tie.

From-SVN: r222719
2015-05-02 12:20:03 +01:00
Ville Voutilainen 261b7e8af2 Implement observer_ptr.
2015-05-01  Ville Voutilainen  <ville.voutilainen@gmail.com>

	Implement observer_ptr.
	* include/Makefile.am: Add new header.
	* include/Makefile.in: Regenerate.
	* include/experimental/memory: New.
	* testsuite/experimental/memory/observer_ptr/assignment/assign.cc: New.
	* testsuite/experimental/memory/observer_ptr/cons/cons.cc: New.
	* testsuite/experimental/memory/observer_ptr/hash/hash.cc: New.
	* testsuite/experimental/memory/observer_ptr/make_observer.cc: New.
	* testsuite/experimental/memory/observer_ptr/relops/relops.cc: New.
	* testsuite/experimental/memory/observer_ptr/requirements.cc: New.
	* testsuite/experimental/memory/observer_ptr/swap/swap.cc: New.
	* testsuite/experimental/memory/observer_ptr/typedefs.cc: New.

From-SVN: r222706
2015-05-01 22:01:11 +01:00
Jonathan Wakely a00d74c490 fs_path.h (path::_List): Use vector instead of list.
* include/experimental/fs_path.h (path::_List): Use vector instead of
	list.
	* python/libstdcxx/v6/printers.py (StdExpPathPrinter): Adapt.
	* src/filesystem/path.cc: Use std::prev instead of decrementing
	rvalues. Fix whitespace.
	* testsuite/experimental/filesystem/path/decompose/parent_path.cc:
	Do not decrement iterators before begin.

From-SVN: r222702
2015-05-01 20:47:55 +01:00
Jonathan Wakely d6e023f3a0 fs_dir.h: Fix use of non-reserved names.
* include/experimental/fs_dir.h: Fix use of non-reserved names.
	* include/experimental/fs_ops.h: Likewise.
	* include/experimental/fs_path.h: Likewise.
	* testsuite/lib/libstdc++.exp (check_v3_target_filesystem_ts): Use
	C++11 when checking for support.

From-SVN: r222695
2015-05-01 18:55:33 +01:00
Jonathan Wakely 6fc456c36b memory (pointer_safety, [...]): Define.
* include/std/memory (pointer_safety, declare_reachable,
	undeclare_reachable, declare_no_pointers, undeclare_no_pointers,
	get_pointer_safety): Define.
	* testsuite/20_util/pointer_safety/1.cc: New.

From-SVN: r222674
2015-05-01 12:02:18 +01:00
Jonathan Wakely 0ca7ba9aa6 Implement N4100 File System TS
* acinclude.m4 (GLIBCXX_ENABLE_FILESYSTEM_TS): Define.
	(GLIBCXX_CHECK_FILESYSTEM_DEPS): Define.
	* config.h.in: Regenerate.
	* configure: Regenerate.
	* configure.ac: Enable filesystem TS and check its dependencies.
	* include/Makefile.am: Add new headers.
	* include/Makefile.in: Regenerate.
	* include/bits/locale_conv.h (__do_str_code_cvt, __str_codecvt_in,
	__str_codecvt_out): Move code conversion logic from wstring_convert
	into new global functions.
	(wstring_convert::to_bytes, wstring_convert::from_bytes): Use new
	functions.
	(wstring_convert::_M_conv): Remove.
	* include/bits/quoted_string.h (_Quoted_string): Split out of iomanip.
	* include/experimental/filesystem: New.
	* include/experimental/fs_dir.h: New.
	* include/experimental/fs_fwd.h: New.
	* include/experimental/fs_ops.h: New.
	* include/experimental/fs_path.h: New.
	* include/std/iomanip (_Quoted_string): Move to bits/quoted_string.h.
	* python/libstdcxx/v6/printers.py (StdExpPathPrinter): Add.
	* src/Makefile.am (SUBDIRS): Add filesystem.
	* src/Makefile.in: Regenerate.
	* src/filesystem/Makefile.am: New.
	* src/filesystem/Makefile.in: New.
	* src/filesystem/dir.cc: New.
	* src/filesystem/ops.cc: New.
	* src/filesystem/path.cc: New.
	* testsuite/experimental/filesystem/operations/absolute.cc: New.
	* testsuite/experimental/filesystem/operations/copy.cc: New.
	* testsuite/experimental/filesystem/operations/current_path.cc: New.
	* testsuite/experimental/filesystem/path/append/path.cc: New.
	* testsuite/experimental/filesystem/path/assign/assign.cc: New.
	* testsuite/experimental/filesystem/path/assign/copy.cc: New.
	* testsuite/experimental/filesystem/path/compare/compare.cc: New.
	* testsuite/experimental/filesystem/path/compare/path.cc: New.
	* testsuite/experimental/filesystem/path/compare/strings.cc: New.
	* testsuite/experimental/filesystem/path/concat/path.cc: New.
	* testsuite/experimental/filesystem/path/concat/strings.cc: New.
	* testsuite/experimental/filesystem/path/construct/copy.cc: New.
	* testsuite/experimental/filesystem/path/construct/default.cc: New.
	* testsuite/experimental/filesystem/path/construct/locale.cc: New.
	* testsuite/experimental/filesystem/path/construct/range.cc: New.
	* testsuite/experimental/filesystem/path/decompose/extension.cc: New.
	* testsuite/experimental/filesystem/path/decompose/filename.cc: New.
	* testsuite/experimental/filesystem/path/decompose/parent_path.cc:
	New.
	* testsuite/experimental/filesystem/path/decompose/relative_path.cc:
	New.
	* testsuite/experimental/filesystem/path/decompose/root_directory.cc:
	New.
	* testsuite/experimental/filesystem/path/decompose/root_name.cc:
	New.
	* testsuite/experimental/filesystem/path/decompose/root_path.cc:
	New.
	* testsuite/experimental/filesystem/path/decompose/stem.cc: New.
	* testsuite/experimental/filesystem/path/generic/generic_string.cc:
	New.
	* testsuite/experimental/filesystem/path/itr/traversal.cc: New.
	* testsuite/experimental/filesystem/path/modifiers/clear.cc: New.
	* testsuite/experimental/filesystem/path/modifiers/make_preferred.cc:
	New.
	* testsuite/experimental/filesystem/path/modifiers/remove_filename.cc:
	New.
	* testsuite/experimental/filesystem/path/modifiers/replace_extension.cc:
	New.
	* testsuite/experimental/filesystem/path/modifiers/replace_filename.cc:
	New.
	* testsuite/experimental/filesystem/path/modifiers/swap.cc: New.
	* testsuite/experimental/filesystem/path/nonmember/hash_value.cc: New.
	* testsuite/experimental/filesystem/path/query/empty.cc: New.
	* testsuite/experimental/filesystem/path/query/has_extension.cc: New.
	* testsuite/experimental/filesystem/path/query/has_filename.cc: New.
	* testsuite/experimental/filesystem/path/query/has_parent_path.cc:
	New.
	* testsuite/experimental/filesystem/path/query/has_relative_path.cc:
	New.
	* testsuite/experimental/filesystem/path/query/has_root_directory.cc:
	New.
	* testsuite/experimental/filesystem/path/query/has_root_name.cc:
	New.
	* testsuite/experimental/filesystem/path/query/has_root_path.cc:
	New.
	* testsuite/experimental/filesystem/path/query/has_stem.cc: New.
	* testsuite/experimental/filesystem/path/query/is_relative.cc: New.
	* testsuite/util/testsuite_fs.h: New.

From-SVN: r222654
2015-04-30 20:11:52 +01:00
Edward Smith-Rowland c0b12dad93 Add fundamentals TR container erasure.
2015-04-30  Edward Smith-Rowland  <3dw4rd@verizon.net>

	Add fundamentals TR container erasure.
	* include/Makefile.am: Add new headers.
	* include/Makefile.in: Add new headers.
	* include/experimental/array: New.
	* include/experimental/deque: New.
	* include/experimental/erase_if.tcc: New.
	* include/experimental/forward_list: New.
	* include/experimental/list: New.
	* include/experimental/map: New.
	* include/experimental/set: New.
	* include/experimental/string: New.
	* include/experimental/unordered_map: New.
	* include/experimental/unordered_set: New.
	* include/experimental/vector: New.
	* testsuite/experimental/deque/erasure.cc: New.
	* testsuite/experimental/forward_list/erasure.cc: New.
	* testsuite/experimental/list/erasure.cc: New.
	* testsuite/experimental/map/erasure.cc: New.
	* testsuite/experimental/set/erasure.cc: New.
	* testsuite/experimental/string/erasure.cc: New.
	* testsuite/experimental/unordered_map/erasure.cc: New.
	* testsuite/experimental/unordered_set/erasure.cc: New.
	* testsuite/experimental/vector/erasure.cc: New.

From-SVN: r222630
2015-04-30 14:43:19 +00:00
Doug Evans 8996b63b09 re PR libstdc++/65839 (xmethods need updating once gdb decides how to fix 18285)
PR libstdc++/65839
	* python/libstdcxx/v6/xmethods.py (get_bool_type): New function.
	Replace all lookups of "bool" with this.
	(get_std_size_type): New function.  Replace all lookups of std::size_t
	with this.
	(*Worker): New method get_result_type.
	(DequeWorkerBase.__init__): New arg val_type.  All callers updated.
	(ListWorkerBase.__init__): New arg val_type.  All callers updated.
	(UniquePtrGetWorker.__init__): New arg elem_type.  All callers updated.
	Delete setting of name, enabled.
	(UniquePtrDerefWorker.__init__): New arg elem_type.  All callers
	updated.  Delete setting of name.
	(UniquePtrMethodsMatcher): Rewrite for consistency with all other
	libstdc++ xmethod matchers.
	* testsuite/libstdc++-xmethods/array.cc: Add whatis tests.
	* testsuite/libstdc++-xmethods/associative-containers.cc: Ditto.
	* testsuite/libstdc++-xmethods/deque.cc: Ditto.
	* testsuite/libstdc++-xmethods/forwardlist.cc: Ditto.
	* testsuite/libstdc++-xmethods/list.cc: Ditto.
	* testsuite/libstdc++-xmethods/unique_ptr.cc: Ditto.
	* testsuite/libstdc++-xmethods/vector.cc: Ditto.

From-SVN: r222599
2015-04-29 22:50:31 +00:00
Jonathan Wakely 952bc7a64c re PR libstdc++/65760 (invalid use of incomplete type with std::is_convertible<C, C>)
PR libstdc++/65760
	* include/std/functional (__check_func_return_type): Use is_same to
	avoid using _is_convertible on incomplete types.
	* testsuite/20_util/function/65760.cc: New.

From-SVN: r222581
2015-04-29 17:07:47 +01:00
Jonathan Wakely f970a17d6f re PR libstdc++/64657 (Support iterators with overloaded operator-comma)
PR libstdc++/64657
	* include/bits/basic_string (basic_string::_S_copy_chars): Cast
	expression to void.
	* include/bits/locale_facets_nonio.tcc (money_get::_M_extract,
	time_get::_M_extract_num, time_get::_M_extract_name,
	time_get::_M_extract_wday_or_month): Likewise.
	* include/bits/stl_algo.h (__includes, __replace_copy_if,
	__is_sorted_until, __is_permutation, transform): Likewise.
	* include/bits/stl_algobase.h (swap_ranges, __copy_move::__copy_m,
	__equal::equal, __lexicographical_compare_impl, equal): Likewise.
	* include/bits/stl_numeric.h (inner_product): Likewise.
	* include/bits/stl_uninitialized.h (__uninitialized_copy_a): Likewise.
	* testsuite/util/testsuite_iterators.h (output_iterator_wrapper,
	input_iterator_wrapper): Declare unusable comma operator.
	* testsuite/21_strings/basic_string/cons/char/64657.cc: New.
	* testsuite/21_strings/basic_string/modifiers/assign/char/64657.cc:
	New.

From-SVN: r222579
2015-04-29 16:22:13 +01:00
Doug Evans 874ef163cf list.cc (_GLIBCXX_USE_CXX11_ABI): Define to zero.
* testsuite/libstdc++-xmethods/list.cc (_GLIBCXX_USE_CXX11_ABI):
	Define to zero.

From-SVN: r222556
2015-04-29 00:17:09 +00:00
Jonathan Wakely 73d81d3a6b re PR libstdc++/60333 (type_traits make_signed, make_unsigned missing support for long long enumerations)
PR libstdc++/60333
	* include/std/type_traits (__make_unsigned_selector<_Tp, false, true>):
	Handle enumeration types larger than sizeof(long).
	(__make_signed_selector<_Tp, false, true>): Find unsigned type then
	make it signed.
	* testsuite/20_util/declval/requirements/1_neg.cc: Adjust dg-error.
	* testsuite/20_util/make_signed/requirements/typedefs_neg.cc:
	Likewise.
	* testsuite/20_util/make_signed/requirements/typedefs-3.cc: New.
	* testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Adjust
	dg-error.
	* testsuite/20_util/make_unsigned/requirements/typedefs-3.cc: New.

From-SVN: r222526
2015-04-28 14:21:54 +01:00
Jonathan Wakely d747ee05e3 re PR libstdc++/65631 (seed_seq should not be copyable)
PR libstdc++/65631
	* include/bits/random.h (seed_seq) Define copy constructor and copy
	assignment as deleted.
	* testsuite/26_numerics/random/seed_seq/cons/65631.cc: New.

From-SVN: r222524
2015-04-28 13:35:30 +01:00
Jonathan Wakely 196e0493cb exception (uncaught_exceptions): Add comment.
* libsupc++/exception (uncaught_exceptions): Add comment. Reorder #if.
	* testsuite/18_support/uncaught_exceptions/uncaught_exceptions.cc:
	Use -std=gnu++1z. Check feature-test macro.

From-SVN: r222523
2015-04-28 13:07:40 +01:00
Jonathan Wakely bd1eb5e092 type_traits (void_t): Add.
* include/std/type_traits (void_t): Add.
	* testsuite/20_util/void_t/1.cc: New.

From-SVN: r222522
2015-04-28 13:07:34 +01:00
Tim Shen e4846be7dd regex.tcc: Handle regex_constants::__polynomial.
* include/bits/regex.tcc: Handle regex_constants::__polynomial.
	* include/bits/regex_automaton.tcc: Throw exception when parsing
	back-reference with flag __polynomial.
	* include/bits/regex_constants.h: Add extension flag
	syntax_option_type __polynomial.
	* bits/regex_executor.tcc: Still let BFS process ECMAScript.
	Alternative operation will be fixed in the coming refactoring.
	* testsuite/28_regex/algorithms/regex_search/61424.cc: Turn
	loose match_search_debug to use DFS only.

From-SVN: r222500
2015-04-28 04:16:48 +00:00
Sandra Loosemore 1a9f259288 re PR libstdc++/65909 (check_v3_target_namedlocale blows up on targets that don't support command-line arguments)
2015-04-27  Sandra Loosemore  <sandra@codesourcery.com>

	PR libstdc++/65909

	libstdc++-v3/
	* testsuite/lib/libstdc++.exp (check_v3_target_namedlocale):
	Make the generated test program fail gracefully if the target
	doesn't	support passing command-line arguments.

From-SVN: r222497
2015-04-27 22:40:56 -04:00
Ville Voutilainen 03a16cc404 Add support for std::uncaught_exceptions.
2015-04-27  Ville Voutilainen  <ville.voutilainen@gmail.com>

	Add support for std::uncaught_exceptions.
	* acinclude.m4: Bump libtool_VERSION.
	* config/abi/pre/gnu.ver: Export the new symbol.
	* configure: Regenerate.
	* libsupc++/eh_catch.cc (uncaught_exceptions): New.
	* libsupc++/exception (uncaught_exceptions): New.
	* testsuite/18_support/uncaught_exceptions/uncaught_exceptions.cc: New.
	* testsuite/util/testsuite_abi.cc: Add 3.4.22 as the latest version.

From-SVN: r222482
2015-04-27 21:40:29 +01:00
Dmitry Prokoptsev f5eedc3915 re PR libstdc++/62258 (uncaught_exception() equals to `true' after rethrow_exception())
2015-04-27  Dmitry Prokoptsev  <dprokoptsev@gmail.com>
	    Michael Hanselmann  <public@hansmi.ch>

	PR libstdc++/62258
	* libsupc++/eh_ptr.cc (rethrow_exception): Increment count of
	uncaught exceptions.
	* testsuite/18_support/exception_ptr/62258.cc: New.

Co-Authored-By: Michael Hanselmann <public@hansmi.ch>

From-SVN: r222480
2015-04-27 20:44:30 +01:00
Renlin Li 04934297b8 [PATCH][libstc++v3]Add new dg-require-thread-fence directive.
libstdc++-v3/

2015-04-22  Renlin Li  <renlin.li@arm.com>

	* testsuite/lib/dg-options.exp (dg-require-thread-fence): New.
	* testsuite/lib/libstdc++.exp (check_v3_target_thread_fence): New.
	* testsuite/29_atomics/atomic_flag/clear/1.cc: Use it.
	* testsuite/29_atomics/atomic_flag/test_and_set/explicit.cc: Likewise.
	* testsuite/29_atomics/atomic_flag/test_and_set/implicit.cc: Likewise.

From-SVN: r222324
2015-04-22 14:01:02 +00:00
Marc Glisse 194571f10e re PR libstdc++/61347 (std::distance(list.first(),list.end()) in O(1))
2015-04-14  Marc Glisse  <marc.glisse@inria.fr>

	PR libstdc++/61347
	* include/bits/stl_iterator_base_funcs.h (_List_iterator,
	_List_const_iterator): Declare.
	(__distance): Declare new overloads for _List_iterator and
	_List_const_iterator.
	* include/bits/stl_list.h (__distance): New overloads for
	_List_iterator and _List_const_iterator.
	* testsuite/23_containers/list/61347.cc: New testcase.

From-SVN: r222082
2015-04-14 11:02:48 +00:00
Hans-Peter Nilsson 0357625940 Fix regression for libstdc++-v3/testsuite/29_atomics/atomic/62259.cc as...
Fix regression for libstdc++-v3/testsuite/29_atomics/atomic/62259.cc
as reported at <http://gcc.gnu.org/ml/gcc-patches/2015-04/msg00543.html>.

	* testsuite/29_atomics/atomic/62259.cc: Assert atomic
	alignment is larger-equal, not equal, to default alignment.

From-SVN: r222072
2015-04-14 00:37:57 +00:00
Jonathan Wakely 1fcbcb6b26 re PR libstdc++/65754 (missing exports for fstream constructors)
PR libstdc++/65754
	* config/abi/pre/gnu.ver: Export base object constructors for
	fstreams.
	* config/abi/post/aarch64-linux-gnu/baseline_symbols.txt: Update.
	* config/abi/post/alpha-linux-gnu/baseline_symbols.txt: Update.
	* config/abi/post/ia64-linux-gnu/baseline_symbols.txt: Update.
	* config/abi/post/i386-linux-gnu/baseline_symbols.txt: Update.
	* config/abi/post/i486-linux-gnu/baseline_symbols.txt: Update.
	* config/abi/post/m68k-linux-gnu/baseline_symbols.txt: Update.
	* config/abi/post/powerpc-linux-gnu/baseline_symbols.txt: Update
	* config/abi/post/powerpc64-linux-gnu/baseline_symbols.txt: Update.
	* config/abi/post/powerpc64-linux-gnu/32/baseline_symbols.txt: Update.
	* config/abi/post/s390x-linux-gnu/baseline_symbols.txt: Update.
	* config/abi/post/s390-linux-gnu/baseline_symbols.txt: Update.
	* config/abi/post/solaris2.10/baseline_symbols.txt: Regenerate.
	* config/abi/post/solaris2.10/amd64/baseline_symbols.txt: Likewise.
	* config/abi/post/solaris2.10/sparcv9/baseline_symbols.txt: Likewise.
	* config/abi/post/x86_64-linux-gnu/baseline_symbols.txt: Update.
	* config/abi/post/x86_64-linux-gnu/32/baseline_symbols.txt: Update.
	* config/abi/post/x86_64-linux-gnu/x32/baseline_symbols.txt: Update.
	* testsuite/27_io/basic_fstream/cons/base.cc: New.

From-SVN: r222059
2015-04-13 19:41:42 +01:00
Jonathan Wakely c3d71b62c6 shared_mutex (shared_timed_mutex): Only use pthread_rwlock_t when the POSIX Timeouts option is supported.
* include/std/shared_mutex (shared_timed_mutex): Only use
	pthread_rwlock_t when the POSIX Timeouts option is supported.
	* testsuite/30_threads/shared_lock/cons/5.cc: Remove
	dg-require-gthreads-timed.
	* testsuite/30_threads/shared_lock/cons/6.cc: Likewise.
	* testsuite/30_threads/shared_lock/locking/3.cc: Likewise.
	* testsuite/30_threads/shared_lock/locking/4.cc: Likewise.

From-SVN: r221971
2015-04-10 10:00:00 +01:00
Jonathan Wakely 43b0e124e4 shared_mutex (shared_timed_mutex): Add comments to explain the logic in the non-pthread_rwlock_t version.
* include/std/shared_mutex (shared_timed_mutex): Add comments to
	explain the logic in the non-pthread_rwlock_t version.
	(_Mutex): Remove redundant type.
	(_M_n_readers): Rename to _S_max_readers.
	(_M_write_entered, _M_readers): New convenience functions.
	(lock, lock_shared, try_lock_shared, unlock_shared): Use convenience
	functions. Use predicates with condition variables. Simplify bitwise
	operations.
	(try_lock_for, try_shared_lock_for): Convert duration to time_point
	and call try_lock_until or try_shared_lock_until respectively.
	(try_lock_until, try_shared_lock_until): Wait on the condition
	variables until the specified time passes.
	(unlock): Add Debug Mode assertion.
	(unlock_shared): Add Debug Mode assertion.
	* testsuite/30_threads/shared_timed_mutex/try_lock/3.cc: New.

From-SVN: r221970
2015-04-10 09:59:54 +01:00
Jonathan Wakely 4cbaaa459e re PR libstdc++/65147 (alignment of std::atomic object is not correct)
2015-04-09  Jonathan Wakely  <jwakely@redhat.com>
	    Richard Henderson  <rth@redhat.com>

	PR libstdc++/65147
	* include/bits/atomic_base.h (__atomic_base<_ITp>): Increase
	alignment.
	* include/std/atomic (atomic): For types with a power of two size set
	alignment to at least the size.
	* testsuite/29_atomics/atomic/60695.cc: Adjust dg-error line number.
	* testsuite/29_atomics/atomic/65147.cc: New.
	* testsuite/29_atomics/atomic_integral/65147.cc: New.

Co-Authored-By: Richard Henderson <rth@redhat.com>

From-SVN: r221945
2015-04-09 12:15:44 +01:00
Jonathan Wakely 744e26e71e re PR libstdc++/65630 (operator+ for new std::string not exported)
PR libstdc++/65630
	* config/abi/pre/gnu.ver: Export operator+ for new strings.
	* testsuite/21_strings/basic_string/operators/char/65630.cc: New.
	* testsuite/21_strings/basic_string/operators/wchar_t/65630.cc: New.

From-SVN: r221775
2015-03-30 18:52:37 +01:00
Tim Shen 2894311302 re PR libstdc++/65420 (Enumerators in std::regex_constants should be constexpr variables instead)
PR libstdc++/65420
	* include/bits/regex_constants.h: Use constexpr variables for flags.
	* testsuite/28_regex/constants/constexpr.cc: New testcase.

From-SVN: r221750
2015-03-28 04:17:12 +00:00
Jonathan Wakely 04f69fda7a re PR libstdc++/65499 (Missing "using namespace literals::chrono_literals" in std::chrono)
PR libstdc++/65499
	* include/std/chrono: Add using-directive for literals to std::chrono.
	* testsuite/20_util/duration/literals/65499.cc: New.

From-SVN: r221730
2015-03-27 12:45:10 +00:00
Jonathan Wakely d1a74a287e re PR libstdc++/58038 (std::this_thread::sleep_until can cause inifinite sleep)
PR libstdc++/58038
	PR libstdc++/60421
	* include/std/thread (this_thread::sleep_for): Check for negative
	durations.
	(this_thread::sleep_until): Check for times in the past.
	* testsuite/30_threads/this_thread/58038.cc: New.
	* testsuite/30_threads/this_thread/60421.cc: New.

From-SVN: r221708
2015-03-26 19:59:08 +00:00
Jonathan Wakely 4280698d09 re PR libstdc++/62259 (atomic class doesn't enforce required alignment on powerpc64)
PR libstdc++/62259
	PR libstdc++/65147
	* include/std/atomic (atomic<T>): Increase alignment for types with
	the same size as one of the integral types.
	* testsuite/29_atomics/atomic/60695.cc: Adjust dg-error line number.
	* testsuite/29_atomics/atomic/62259.cc: New.

From-SVN: r221703
2015-03-26 19:27:02 +00:00
Alan Lawrence 28fda0c459 re PR libstdc++/33394 (Add test case for Thread race segfault in std::string::append with -O and -s)
PR libstdc++/33394
	* testsuite/21_strings/basic_string/pthread33394.cc: Use
	dg-additional-options.

From-SVN: r221666
2015-03-25 15:46:58 +00:00
Paolo Carlini ea348bbe59 re PR libstdc++/65543 (rvalue stream insertion and extraction operators incorrectly implemented)
2015-03-25  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/65543
	* include/std/istream (operator>>(basic_istream<>&&, _Tp&): Revert
	thinko in r150387.
	* include/std/ostream (operator<<(basic_ostream<>&&, const _Tp&):
	Likewise.
	* testsuite/27_io/rvalue_streams-2.cc: New.

From-SVN: r221655
2015-03-25 09:57:06 +00:00
Jonathan Wakely 9ccd0dba21 re PR libstdc++/33394 (Add test case for Thread race segfault in std::string::append with -O and -s)
PR libstdc++/33394
	* testsuite/21_strings/basic_string/pthread33394.cc: Add test.

# Auto-generated commit message above this line, original below.
	PR libstdc++/33394
	* testsuite/21_strings/basic_string/pthread33394.cc: Add test.

From-SVN: r221635
2015-03-24 14:47:32 +00:00
James Greenhalgh c00acee464 [Patch Testsuite] Make all_attributes.cc in to (almost_)all_attributes.cc for ARM.
* testsuite/17_intro/headers/c++1998/all_attributes.cc: Disable
	test for unused for ARM.
	* testsuite/17_intro/headers/c++200x/all_attributes.cc: Likewise.
	* testsuite/17_intro/headers/c++2014/all_attributes.cc: Likewise.

From-SVN: r221538
2015-03-20 17:20:12 +00:00
Jonathan Wakely df6d9c7f6a c++config (__gnu_cxx::__cxx11): Define new namespace.
* include/bits/c++config (__gnu_cxx::__cxx11): Define new namespace.
	* include/ext/codecvt_specializations.h (encoding_state,
	encoding_char_traits): Remove abi-tag and use inline namespace.
	* testsuite/ext/profile/mutex_extensions_neg.cc: Adjust dg-error line.

From-SVN: r221533
2015-03-20 13:26:55 +00:00
Jonathan Wakely 1c6f4a147d 1.cc: Remove name of unused exception variable.
* testsuite/30_threads/shared_lock/modifiers/1.cc: Remove name of
	unused exception variable.
	* testsuite/30_threads/unique_lock/modifiers/1.cc: Likewise.
	* testsuite/30_threads/shared_lock/modifiers/2.cc: Remove duplicate
	test.
	* testsuite/30_threads/unique_lock/modifiers/2.cc: Likewise.

From-SVN: r221477
2015-03-17 16:36:32 +00:00
Jonathan Wakely 95f2fd9c5d nested_exception.h: Do not try to derive from final classes.
* libsupc++/nested_exception.h: Do not try to derive from final
	classes.
	* testsuite/18_support/nested_exception/throw_with_nested.cc: Test
	final class.

From-SVN: r221476
2015-03-17 14:24:55 +00:00
Renlin Li 04a1709359 [PATCH]Remove xfail for wrapped target
libstdc++-v3/

2015-03-12  Renlin Li  <renlin.li@arm.com>

	* testsuite/27_io/ios_base/sync_with_stdio/1.cc: Remove xfail for
	wrapped target.

From-SVN: r221393
2015-03-12 15:00:28 +00:00
Tim Shen 84839a5140 re PR libstdc++/64441 (A match_results returns an incorrect sub_match if the sub_match::matched is false)
PR libstdc++/64441
	* include/bits/regex.h (match_results<>::size,
	match_results<>::position, match_results<>::str,
	match_results<>::operator[], match_results<>::prefix,
	match_results<>::suffix, match_results<>::end,
	match_results<>::_M_resize, match_results<>::_M_unmatched_sub,
	match_results<>::_M_prefix, match_results<>::_M_suffix): Remove
	global __unmatched_sub. Add unmatched submatch as part of
	match_results.
	* include/bits/regex.tcc (__regex_algo_impl<>, regex_replace<>,
	regex_iterator<>::operator++): Adjust to use match_results::_M_prefix.
	* testsuite/28_regex/match_results/out_of_range_submatches.cc:
	New testcases.

From-SVN: r221330
2015-03-10 18:41:46 +00:00
Jonathan Wakely d2e0c00b8c re PR libstdc++/64467 (28_regex/traits/char/isctype.cc and wchar_t/isctype.cc)
PR libstdc++/64467
	* testsuite/28_regex/traits/char/isctype.cc: Don't test newline
	for newlib targets. Really fix mixed line-endings this time.

From-SVN: r221279
2015-03-09 12:47:51 +00:00
Jonathan Wakely 9933260f2f locale_conv.h (wstring_convert::_M_conv): Handle noconv result.
* include/bits/locale_conv.h (wstring_convert::_M_conv): Handle
	noconv result.
	* testsuite/22_locale/conversions/string/2.cc: Also test UTF-8.
	* testsuite/22_locale/conversions/string/3.cc: Likewise, and UTF-16.

From-SVN: r221212
2015-03-05 13:36:21 +00:00
Jonathan Wakely b6584a72ac re PR libstdc++/64797 (22_locale/conversions/string/2.cc FAILs)
PR libstdc++/64797
	* include/bits/locale_conv.h (wstring_convert::_M_conv): Handle
	incomplete multibyte sequences correctly.
	* include/std/codecvt (codecvt_utf8, codecvt_utf16,
	codecvt_utf8_utf16): Limit _Maxcode to maximum Unicode code point.
	* src/c++11/codecvt.cc (invalid_mb_sequence, incomplete_mb_character):
	Define constants.
	(is_high_surrogate, is_low_surrogate, surrogate_pair_to_code_point):
	Define convenience functions.
	(read_utf8_code_point): Return relevant constant to distinguish
	incomplete characters from invalid sequences.
	(read_utf16_code_point): Likewise. Check for invalid sequences.
	(ucs4_in, utf16_in): Use incomplete_mb_character constant.
	(utf16_out): Check for invalid sequences.
	(utf16_span): Fix condition.
	(ucs2_out): Use is_high_surrogate.
	(ucs2_in): Use incomplete_mb_character constant and fix condition.
	* testsuite/22_locale/codecvt/char16_t.cc: Fix whitespace.
	* testsuite/22_locale/conversions/buffer/1.cc: New.
	* testsuite/22_locale/conversions/string/2.cc: Use char16_t and
	char32_t instead of wchar_t.
	* testsuite/22_locale/conversions/string/3.cc: New.

From-SVN: r221189
2015-03-04 17:19:55 +00:00