Commit Graph

9309 Commits

Author SHA1 Message Date
Jonathan Wakely
71c54f8ea2 Simplify dg-options for tests using pthreads
* testsuite/21_strings/basic_string/pthread18185.cc: Use -pthread for
	*-*-solaris* instead of -pthreads.
	* testsuite/21_strings/basic_string/pthread4.cc : Likewise.
	* testsuite/22_locale/locale/cons/12658_thread-1.cc: Likewise.
	* testsuite/22_locale/locale/cons/12658_thread-2.cc: Likewise.
	* testsuite/23_containers/list/pthread1.cc: Likewise.
	* testsuite/23_containers/list/pthread5.cc: Likewise.
	* testsuite/23_containers/map/pthread6.cc: Likewise.
	* testsuite/27_io/basic_ofstream/pthread2.cc: Likewise.
	* testsuite/27_io/basic_ostringstream/pthread3.cc: Likewise.
	* testsuite/30_threads/shared_mutex/*: Likewise.
	* testsuite/ext/rope/pthread7-rope.cc: Likewise.
	* testsuite/tr1/2_general_utilities/shared_ptr/thread/
	default_weaktoshared.cc: Likewise.
	* testsuite/tr1/2_general_utilities/shared_ptr/thread/
	mutex_weaktoshared.cc: Likewise.
	* testsuite/20_util/shared_ptr/atomic/3.cc: Likewise. Use
	dg-require-effective-target instead of using -std option.
	* testsuite/20_util/shared_ptr/thread/default_weaktoshared.cc:
	Likewise.
	* testsuite/20_util/shared_ptr/thread/mutex_weaktoshared.cc: Likewise.
	* testsuite/23_containers/vector/debug/multithreaded_swap.cc:
	Likewise.
	* testsuite/30_threads/async/*: Likewise.
	* testsuite/30_threads/call_once/*: Likewise.
	* testsuite/30_threads/condition_variable/*: Likewise.
	* testsuite/30_threads/condition_variable_any/*: Likewise.
	* testsuite/30_threads/future/*: Likewise.
	* testsuite/30_threads/lock/*: Likewise.
	* testsuite/30_threads/mutex/*: Likewise.
	* testsuite/30_threads/packaged_task/*: Likewise.
	* testsuite/30_threads/promise/*: Likewise.
	* testsuite/30_threads/recursive_mutex/*: Likewise.
	* testsuite/30_threads/recursive_timed_mutex/*: Likewise.
	* testsuite/30_threads/shared_future/*: Likewise.
	* testsuite/30_threads/shared_lock/*: Likewise.
	* testsuite/30_threads/shared_timed_mutex/*: Likewise.
	* testsuite/30_threads/this_thread/*: Likewise.
	* testsuite/30_threads/thread/*: Likewise.
	* testsuite/30_threads/timed_mutex/*: Likewise.
	* testsuite/30_threads/try_lock/*: Likewise.
	* testsuite/30_threads/unique_lock/*: Likewise.

From-SVN: r239624
2016-08-19 17:36:07 +01:00
Jonathan Wakely
e6ee5bfd68 Define std::not_fn for C++17
* doc/xml/manual/status_cxx2017.xml: Update status of not_fn.
	* doc/html/*: Regenerate.
	* include/experimental/functional (_Not_fn, not_fn): Match C++17
	semantics.
	* include/std/functional (_Not_fn, not_fn): Define for C++17.
	* testsuite/20_util/not_fn/1.cc: New.
	* testsuite/experimental/functional/not_fn.cc: Test abstract class.
	Remove test for volatile-qualified wrapper.

From-SVN: r239623
2016-08-19 16:42:34 +01:00
Jonathan Wakely
387edf83a0 Define std::atomic<T>::is_always_lock_free for C++17
* include/std/atomic (atomic::is_always_lock_free): Define.
	* testsuite/29_atomics/atomic/60695.cc: Adjust dg-error lineno.
	* testsuite/29_atomics/atomic/is_always_lock_free.cc: New.
	* testsuite/29_atomics/atomic_integral/is_always_lock_free.cc: New.
	* doc/xml/manual/status_cxx2017.xml: Update status.
	* doc/html/*: Regenerate.

From-SVN: r239622
2016-08-19 16:42:27 +01:00
Jonathan Wakely
285ee2fb11 Fix ambiguities in C++17 mode
* include/experimental/tuple (apply): Qualify call to __apply_impl.
	* include/std/tuple (apply): Likewise.
	* testsuite/experimental/system_error/value.cc: Fix ambiguities in
	C++17 mode.
	* testsuite/experimental/tuple/tuple_size.cc: Likewise.
	* testsuite/experimental/type_traits/value.cc: Likewise.

From-SVN: r239621
2016-08-19 16:42:11 +01:00
Jonathan Wakely
1f4ed04ed8 Update C++17 library status table
* doc/xml/manual/status_cxx2017.xml: Update status of make_from_tuple
	and variant.
	* doc/html/*: Regenerate.

From-SVN: r239608
2016-08-19 09:16:13 +01:00
Ville Voutilainen
a577f786b6 Implement the latest proposed resolution of LWG 2756.
* include/std/optional (Optional_base(const _Tp&))
	(Optional_base(_Tp&&), using _Base::_Base): Remove.
	(optional(nullopt_t)): New.
	(optional(_Up&&)): Invoke base directly with in_place
	rather than creating a temporary, add default template
	argument, change constraints.
	(optional(const optional<_Up>&)): Invoke base directly
	with in_place, remove unnecessary constraints.
	(optional(optional<_Up>&& __t)): Likewise.
	(optional(in_place_t, _Args&&...)): New.
	(optional(in_place_t, initializer_list<_Up>, _Args&&...)): Likewise.
	(operator=(_Up&&)): Add default template argument, change constraints.
	(operator=(const optional<_Up>&)): Put is_same first in the
	constraints.
	(operator=(optional<_Up>&&)): Likewise.
	* testsuite/20_util/optional/assignment/5.cc: Add a test to
	verify assignment from something that can't be perfect-forwarded.
	* testsuite/20_util/optional/cons/value.cc: Add tests to verify
	that a nested optional is disengaged when constructed
	from a disengaged element type,	and to verify that assignments
	from an engaged element type engage the optional.

From-SVN: r239593
2016-08-18 23:33:57 +03:00
Tim Shen
197c757cb1 Implement <variant>
* include/Makefile.am: Add new file std/variant.
	* include/Makefile.in: Generated from Makefile.am.
	* include/bits/enable_special_members.h: Add a tag type to allow
	the construction in non-default constructor.
	* include/bits/uses_allocator.h: Add convenience traits to
	detect constructibility.
	* include/std/variant: Implement <variant>.
	* testsuite/20_util/variant/compile.cc: Compile-time tests.
	* testsuite/20_util/variant/run.cc: Runtime tests.

From-SVN: r239590
2016-08-18 20:31:26 +00:00
Jonathan Wakely
0b224dcf60 Expand libstdc++ docs on testing
* doc/xml/manual/test.xml (test.run.permutations): Expand section.
	(test.new_tests): Rewrite section.
	(tests.dg.directives): New section.
	* doc/html/*: Regenerate.

From-SVN: r239574
2016-08-18 14:47:42 +01:00
Jonathan Wakely
b56d48ef86 Improve documentation of libstdc++ test targets
* doc/xml/manual/test.xml: Improve documentation of test targets.
	Document new-abi-baseline, check-debug, and check-parallel targets.

From-SVN: r239573
2016-08-18 14:47:37 +01:00
Jonathan Wakely
409d55557b Document libstdc++.so versioning in manual
* doc/xml/manual/build_hacking.xml: New section on shared library
	versioning.

From-SVN: r239572
2016-08-18 14:47:33 +01:00
Jonathan Wakely
a8107a983f Improve markup in libstdc++ manual
* doc/xml/manual/build_hacking.xml: Improve markup.
	* doc/xml/manual/test.xml: Likewise. Change section title from "Test"
	to "Testing".
	* doc/xml/faq.xml: Change link text to "Testing".

From-SVN: r239571
2016-08-18 14:47:28 +01:00
Jonathan Wakely
6cb9849199 Remove unintended dg-options directive
* testsuite/tr1/3_function_objects/function/10.cc: Remove unintended
	dg-options directive.

From-SVN: r239564
2016-08-18 10:58:28 +01:00
Jonathan Wakely
6fbf26cc57 Fix invalid dg-do directive
* testsuite/20_util/reference_wrapper/invoke-2.cc: Fix invalid dg-do
	directive and use effective target instead of dg-options.

From-SVN: r239548
2016-08-17 20:58:44 +01:00
Jonathan Wakely
18a20f3f25 Use effective target instead of -std in dg-options
* testsuite/20_util/hash/chi2_q_bit_flip_set.cc: Use effective target
	instead of -std in dg-options.
	* testsuite/20_util/hash/chi2_q_bit_string_set.cc: Likewise.
	* testsuite/20_util/hash/chi2_q_numeric_pattern_set.cc: Likewise.
	* testsuite/20_util/hash/chi2_q_uniform_random.cc: Likewise.
	* testsuite/20_util/hash/quality.cc: Likewise.
	* testsuite/25_algorithms/heap/moveable.cc: Likewise.
	* testsuite/25_algorithms/heap/moveable2.cc: Likewise.
	* testsuite/25_algorithms/nth_element/random_test.cc: Likewise.
	* 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.

From-SVN: r239547
2016-08-17 20:43:13 +01:00
Jonathan Wakely
f771720378 Add c++11 effective target to tests for C++11 features
* testsuite/20_util/tuple/67844.cc: Require c++11 effective target.
	* testsuite/20_util/tuple/cons/nested_tuple_construct.cc: Likewise.
	* testsuite/27_io/rvalue_streams.cc: Likewise.

From-SVN: r239545
2016-08-17 20:23:15 +01:00
Jonathan Wakely
e30c6e0c14 Add comment explaining why -std=c++14 is needed.
* testsuite/26_numerics/complex/literals/types.cc: Add comment.

From-SVN: r239543
2016-08-17 17:09:15 +01:00
Jonathan Wakely
e07f4b008d Remove duplicate dg-options directive
* testsuite/21_strings/basic_string_view/operations/rfind/char/2.cc:
	Remove duplicate dg-options directive.

From-SVN: r239538
2016-08-17 15:11:20 +01:00
Jonathan Wakely
37144e84aa Adjust DG directives in libstdc++ Profile Mode test
* testsuite/ext/profile/all.cc: Use effective target instead of
	-std=gnu++11. Use dg-additional-options instead of repeating options.

From-SVN: r239536
2016-08-17 14:39:14 +01:00
Jonathan Wakely
8fe79e7334 Adjust DG directives in libstdc++ XFAIL test
* testsuite/20_util/bind/ref_neg.cc: Use effective target instead of
	-std=gnu++11. Add -fno-show-columns to dg-options. Use dg-prune-output
	instead of dg-excess-errors.

From-SVN: r239535
2016-08-17 14:39:10 +01:00
Jonathan Wakely
c42966921a Adjust testcases for C++17 compatibility
* testsuite/26_numerics/headers/cmath/types_std_c++0x_neg.cc: Disable
	test for C++17.
	* testsuite/experimental/chrono/value.cc: Avoid ambiguities in C++17.
	* testsuite/experimental/ratio/value.cc: Likewise.
	* testsuite/ext/pb_ds/regression/hash_map_rand.cc: Disable test for
	C++17.
	* testsuite/ext/pb_ds/regression/hash_set_rand.cc: Likewise.
	* testsuite/ext/pb_ds/regression/list_update_map_rand.cc: Likewise.
	* testsuite/ext/pb_ds/regression/list_update_set_rand.cc: Likewise.
	* testsuite/ext/pb_ds/regression/priority_queue_rand.cc: Likewise.
	* testsuite/ext/pb_ds/regression/tree_map_rand.cc: Likewise.
	* testsuite/ext/pb_ds/regression/tree_set_rand.cc: Likewise.
	* testsuite/ext/pb_ds/regression/trie_map_rand.cc: Likewise.
	* testsuite/ext/pb_ds/regression/trie_set_rand.cc: Likewise.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	10_cyl_bessel_k/airy.cc: Adjust namespace of __detail::__airy for
	C++17 compatibility.

From-SVN: r239534
2016-08-17 14:39:05 +01:00
Jonathan Wakely
ba364478df Adjust testcase for C++14 compatibility
* testsuite/24_iterators/headers/iterator/range_access.cc: Adjust
	expected signatures for C++14 compatibility.

From-SVN: r239533
2016-08-17 14:38:58 +01:00
Jonathan Wakely
657213f736 PR 77264 constrain new std::basic_string overloads
PR libstdc++/77264
	* include/bits/basic_string.h (operator=(__sv_type)
	(append(__sv_type), assign(__sv_type), insert(size_type, __sv_type))
	(replace(size_type, size_type, __sv_type))
	(replace(const_iterator, const_iterator, __sv_type))
	(find(__sv_type, size_type), rfind(__sv_type, size_type))
	(compare(size_type, size_type, __sv_type)): Reformat.
	(_If_sv): Define helper for SFINAE constaints.
	(append(const _Tp&, size_type, size_type))
	(assign(const _Tp&, size_type, size_type))
	(insert(size_type, const _Tp&, size_type, size_type))
	(replace(size_type, size_type, const _Tp&, size_type, size_type)):
	Use _If_sv.
	* testsuite/21_strings/basic_string/modifiers/append/char/4.cc: Test
	SFINAE constraints.
	* testsuite/21_strings/basic_string/modifiers/append/wchar_t/4.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/replace/char/7.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/replace/wchar_t/7.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/assign/char/4.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/assign/wchar_t/4.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/insert/char/3.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/insert/wchar_t/3.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/replace/char/7.cc:
	Likewise.
	* testsuite/21_strings/basic_string/operations/compare/char/2.cc:
	Likewise.
	* testsuite/21_strings/basic_string/operations/compare/wchar_t/2.cc:
	Likewise.

From-SVN: r239532
2016-08-17 14:38:52 +01:00
Jonathan Wakely
32917686b0 PR 72847 Prevent double-free in std::vector<bool>
PR libstdc++/72847
	* include/bits/stl_bvector.h (_Bvector_base::_M_deallocate): Zero
	pointers to start and end of storage.
	* testsuite/23_containers/vector/bool/72847.cc: New test.
	* include/bits/vector.tcc (vector<bool>::_M_reallocate): Only update
	_M_finish after deallocating.
	(vector<bool>::_M_fill_insert): Likewise.
	(vector<bool>::_M_insert_range): Likewise.
	(vector<bool>::_M_insert_aux): Likewise.

From-SVN: r239497
2016-08-16 12:33:16 +01:00
Ville Voutilainen
5c578ae434 Implement LWG 2744 and LWG 2754.
* include/std/any (any(ValueType&&)): Constrain with __is_in_place_type.
	(any(in_place_type_t<_ValueType>, _Args&&...)): Use _Decay.
	(any(in_place_type_t<_ValueType>, initializer_list<_Up>, _Args&&...)):
	Likewise.
	(emplace(_Args&&...)): Likewise.
	(emplace(initializer_list<_Up>, _Args&&...)): Likewise.
	* include/std/utility: (__is_in_place_type_impl): New.
	(__is_in_place_type): Likewise.
	* testsuite/20_util/any/assign/emplace.cc: Add tests for decaying
	emplace.
	* testsuite/20_util/any/cons/in_place.cc: Add tests for decaying
	in_place constructor.
	* testsuite/20_util/any/misc/any_cast_neg.cc: Adjust.
	* testsuite/20_util/any/requirements.cc: Add a test for
	in_place-constructing a non-default-constructible type.

From-SVN: r239482
2016-08-15 18:06:09 +03:00
Ville Voutilainen
24299f6544 Add a feature macro for C++17 make_from_tuple.
* include/std/tuple (__cpp_lib_make_from_tuple): New.
	* testsuite/20_util/tuple/make_from_tuple/1.cc: Adjust.

From-SVN: r239480
2016-08-15 15:46:47 +03:00
Uros Bizjak
0657379e3b ops.cc: Always include ostream and ext/stdio_filebuf.h.
* src/filesystem/ops.cc: Always include ostream and
	ext/stdio_filebuf.h.
	(do_copy_file): Check if _GLIBCXX_USE_FCHMODAT is defined.
	[_GLIBCXX_USE_SENDFILE]: Fallback to read/write operations in case
	sendfile fails with ENOSYS or EINVAL.

From-SVN: r239479
2016-08-15 13:40:37 +02:00
Thomas Preud'homme
f9657322cf re PR testsuite/72840 (PASS->NA: 20_util/ratio/cons/cons_overflow_neg.cc)
2016-08-15  Thomas Preud'homme  <thomas.preudhomme@arm.com>

    PR libstdc++/72840
    * testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Fix dg-error
    syntax.

From-SVN: r239463
2016-08-15 09:14:15 +00:00
Ville Voutilainen
ca1ab6be3b Implement C++17 make_from_tuple.
* include/std/tuple (__make_from_tuple_impl, make_from_tuple): New.
	* testsuite/20_util/tuple/make_from_tuple/1.cc: Likewise.

From-SVN: r239372
2016-08-11 17:51:47 +03:00
Ville Voutilainen
68a51b68bd Implement LWG 2758.
* include/bits/basic_string.h
	(append(__sv_type, size_type, size_type)): Turn into a template,
	change parameter type, constrain, add a conversion to __sv_type
	from the dependent parameter type.
	(assign(__sv_type, size_type, size_type)): Likewise.
	(insert(size_type, __sv_type, size_type, size_type)): Likewise.
	(replace(size_type, size_type, __sv_type, size_type, size_type)):
	Likewise.
	(compare(size_type, size_type,__sv_type, size_type, size_type)):
	Likewise.
	* testsuite/21_strings/basic_string/lwg2758.cc: New.

From-SVN: r239370
2016-08-11 17:45:23 +03:00
Jonathan Wakely
caee9cdee7 Update C++17 library status table
* doc/xml/manual/status_cxx2017.xml: Update status table.
	* doc/html/manual/status.html: Regenerate.

From-SVN: r239209
2016-08-06 13:45:58 +01:00
Jonathan Wakely
ea2f1f4947 * testsuite/lib/libstdc++.exp: Fix typo in comment.
From-SVN: r239193
2016-08-06 11:44:17 +01:00
Jonathan Wakely
6ef835c6c0 Use ::new to avoid finding overloaded operator new
PR libstdc++/72820
	* include/std/functional (_Function_base::_Base_manager::_M_clone):
	Qualify new operator.
	* testsuite/20_util/function/cons/72820.cc: New test.

From-SVN: r239191
2016-08-06 11:21:07 +01:00
Jonathan Wakely
3e9f67e6a2 Add std::apply for C++17
* doc/xml/manual/status_cxx2017.xml: Add missing LFTSv2 features.
	* doc/html/manual/status.html: Regenerate.
	* include/Makefile.am: Add new header.
	* include/Makefile.in: Regenerate.
	* include/bits/invoke.h: New header.
	(__invoke): Make constexpr. Add && to types in exception specification.
	* include/experimental/tuple (apply, __apply_impl): Fix non-reserved
	names. Include <bits/invoke.h> and use std::__invoke.
	* include/std/functional (__invfwd, __invoke_impl, __invoke): Move to
	new header.
	(invoke): Add && to types in exception specification.
	* include/std/tuple (apply, __apply_impl): Define for C++17.
	* testsuite/20_util/tuple/apply/1.cc: New test.
	* testsuite/20_util/tuple/element_access/get_neg.cc: Adjust dg-error
	lineno.

From-SVN: r239183
2016-08-06 01:06:02 +01:00
Jonathan Wakely
a0b1bf2181 Correct status of __cpp_lib_enable_shared_from_this
* doc/xml/manual/status_cxx2017.xml: Correct shared_from_this status.
	* doc/html/manual/status.html: Regenerate.

From-SVN: r239171
2016-08-05 14:57:30 +01:00
Jonathan Wakely
5f6acdfb0b Implement C++17 rounding functions for std::chrono (P0092R1)
* include/std/chrono (floor, ceil, round, abs): New for C++17.
	* testsuite/20_util/duration_cast/rounding.cc: New test.
	* testsuite/20_util/time_point_cast/rounding.cc: New test.
	* doc/xml/manual/status_cxx2017.xml: Update status table.
	* doc/html/manual/status.html: Regenerate.
	* testsuite/20_util/duration/requirements/typedefs_neg1.cc: Adjust
	dg-error lineno.
	* testsuite/20_util/duration/requirements/typedefs_neg2.cc: Likewise.
	* testsuite/20_util/duration/requirements/typedefs_neg3.cc: Likewise.
	* testsuite/20_util/duration/literals/range.cc: Likewise.

From-SVN: r239170
2016-08-05 14:52:59 +01:00
Jonathan Wakely
98e6e66233 Use __invoke in std::function internals
* include/std/functional (__callable_functor): Remove.
	(_Function_handler::_M_invoke): Use __invoke instead of
	__callable_functor or mem_fn.
	(function::_Callable): Use lvalue in result_of expression.
	(function): Remove TODO comments about allocators.
	* testsuite/20_util/function/cons/refqual.cc: New test.

From-SVN: r239166
2016-08-05 10:00:34 +01:00
Jonathan Wakely
42183d034d Define std::is_callable and std::is_nothrow_callable
* doc/xml/manual/status_cxx2017.xml: Update status table.
	* include/std/functional (__inv_unwrap): Move to <type_traits>.
	(__invoke_impl): Remove exception specifications.
	(__invoke, invoke): Add exception specifications using
	__is_nothrow_callable.
	* include/std/type_traits (__inv_unwrap): Move from <functional>.
	(__is_callable_impl, __call_is_nt, __call_is_nothrow): New helpers.
	(__is_callable, __is_nothrow_callable): New traits.
	(is_callable, is_callable_v): New C++17 traits.
	(is_nothrow_callable, is_nothrow_callable_v): Likewise.
	* testsuite/20_util/is_callable/requirements/
	explicit_instantiation.cc: New test.
	* testsuite/20_util/is_callable/requirements/
	explicit_instantiation_ext.cc: New test.
	* testsuite/20_util/is_callable/requirements/typedefs.cc: New test.
	* testsuite/20_util/is_callable/requirements/typedefs_ext.cc: New
	test.
	* testsuite/20_util/is_callable/value.cc: New test.
	* testsuite/20_util/is_callable/value_ext.cc: New test.
	* testsuite/20_util/is_nothrow_callable/requirements/
	explicit_instantiation.cc: New test.
	* testsuite/20_util/is_nothrow_callable/requirements/
	explicit_instantiation_ext.cc: New test.
	* testsuite/20_util/is_nothrow_callable/requirements/typedefs.cc:
	New test.
	* testsuite/20_util/is_nothrow_callable/requirements/typedefs_ext.cc:
	New test.
	* testsuite/20_util/is_nothrow_callable/value.cc: New test.
	* testsuite/20_util/is_nothrow_callable/value_ext.cc: New test.

From-SVN: r239145
2016-08-04 19:02:56 +01:00
Jonathan Wakely
246c618e71 Update C++17 library implementation status table
* doc/xml/manual/status_cxx2017.xml: Update C++17 status table.
	* doc/html/manual/status.html: Regenerate.

From-SVN: r239124
2016-08-04 14:33:02 +01:00
Jonathan Wakely
9a8e528cf1 Define std::enable_shared_from_this::weak_from_this
* testsuite/20_util/enable_shared_from_this/members/reinit.cc: Use
	effective target not dg-options. Move check for feature-test macro to:
	* testsuite/20_util/enable_shared_from_this/members/weak_from_this.cc:
	New test.

From-SVN: r239121
2016-08-04 13:33:10 +01:00
Jonathan Wakely
7d2035fafe Simplify std::__invoke_impl definitions
* include/std/functional (_Unwrap): Rename to __inv_unwrap.
	(__invfwd): Adjust.
	(__invoke_impl): Remove unused template parameters.
	* testsuite/20_util/function_objects/invoke/59768.cc: Remove unused
	parameter.
	* testsuite/20_util/function_objects/invoke/ref_ext.cc: Copy 59768.cc
	and test __invoke extension for C++11.

From-SVN: r239120
2016-08-04 12:09:29 +01:00
Jonathan Wakely
c7fdbdcdbd Define feature-test macro for std::enable_shared_from_this
* include/bits/shared_ptr_base.h (__cpp_lib_enable_shared_from_this):
	Define feature-test macro.
	* testsuite/20_util/enable_shared_from_this/members/reinit.cc: Test
	for the macro.

From-SVN: r239094
2016-08-03 20:10:06 +01:00
Jonathan Wakely
f21f4463ad Define std::shared_ptr::weak_type
* include/bits/shared_ptr.h (shared_ptr::weak_type): Define.
	* include/bits/shared_ptr_base.h (__shared_ptr::weak_type): Define.
	* testsuite/20_util/shared_ptr/cons/43820_neg.cc: Adjust dg-error.
	* testsuite/20_util/shared_ptr/requirements/weak_type.cc: New test.
	* testsuite/20_util/shared_ptr/cons/void_neg.cc: Likewise.

From-SVN: r239093
2016-08-03 20:09:57 +01:00
Jonathan Wakely
32eaac9c91 Define std::as_const
* include/std/utility (as_const): Define.
	* testsuite/20_util/as_const/1.cc: New test.
	* testsuite/20_util/as_const/rvalue_neg.cc: New test.

From-SVN: r239090
2016-08-03 19:11:23 +01:00
Jonathan Wakely
b7dabce5f3 Define std::owner_less<void> specialization (P0074R0)
* include/bits/shared_ptr.h (owner_less): Add default template
	argument.
	* include/bits/shared_ptr_base.h (_Sp_owner_less<void, void>): Define
	specialization.
	(owner_less<void>): Define specialization.
	* include/bits/stl_function.h (__cpp_lib_transparent_operators):
	Update value.
	* testsuite/20_util/owner_less/void.cc: New test.
	* testsuite/experimental/feat-cxx14.cc: Update macro value tested.

From-SVN: r239089
2016-08-03 19:11:18 +01:00
Jonathan Wakely
068c8ac17c Define C++17 feature-test macros
* include/bits/allocator.h (__cpp_lib_incomplete_container_elements):
	Define feature-test macro.
	* include/bits/range_access.h (__cpp_lib_array_constexpr): Likewise.
	* include/std/shared_mutex (__cpp_lib_shared_mutex): Uncomment.
	* include/std/type_traits (__cpp_lib_logical_traits): Fix value.
	(__cpp_lib_type_trait_variable_templates): Define.

From-SVN: r239088
2016-08-03 19:11:10 +01:00
Jonathan Wakely
0bd9bdb4db Define __cpp_lib_generic_associative_lookup feature-test macro
* include/bits/stl_function.h: Remove commented-out macro.
	* include/bits/stl_tree.h (__cpp_lib_generic_associative_lookup):
	Define feature-test macro.
	* testsuite/experimental/feat-cxx14.cc: Add tests for more macros.

From-SVN: r239084
2016-08-03 17:42:31 +01:00
Jonathan Wakely
f8571e5150 Enable Mathematical Special Functions for C++17
* include/bits/c++config (_GLIBCXX_USE_STD_SPEC_FUNCS): Define for
	C++17, or for C++11/C++14 when __STDCPP_WANT_MATH_SPEC_FUNCS__ is
	true.
	* include/bits/specfun.h [!__STDCPP_WANT_MATH_SPEC_FUNCS__]: Don't
	do #error for C++17.
	* include/c_global/cmath: Check _GLIBCXX_USE_STD_SPEC_FUNCS instead
	of __STDCPP_WANT_MATH_SPEC_FUNCS__.
	* include/tr1/bessel_function.tcc: Likewise.
	* include/tr1/beta_function.tcc: Likewise.
	* include/tr1/cmath: Likewise.
	* include/tr1/ell_integral.tcc: Likewise.
	* include/tr1/exp_integral.tcc: Likewise.
	* include/tr1/gamma.tcc: Likewise.
	* include/tr1/hypergeometric.tcc: Likewise.
	* include/tr1/legendre_function.tcc: Likewise.
	* include/tr1/modified_bessel_func.tcc: Likewise.
	* include/tr1/poly_hermite.tcc: Likewise.
	* include/tr1/poly_laguerre.tcc: Likewise.
	* include/tr1/riemann_zeta.tcc: Likewise.
	* include/tr1/special_function_util.h: Likewise.
	* testsuite/26_numerics/headers/cmath/functions_std_c++17.cc: New.

From-SVN: r239081
2016-08-03 16:54:13 +01:00
Jonathan Wakely
27631a2542 Remove deprecated has_trivial_xxx traits
* include/std/type_traits (has_trivial_default_constructor): Remove.
	(has_trivial_copy_constructor, has_trivial_copy_assign): Likewise.
	* testsuite/20_util/has_trivial_copy_assign/requirements/
	explicit_instantiation.cc: Remove test.
	* testsuite/20_util/declval/requirements/1_neg.cc: Adjust dg-error
	line number.
	* testsuite/20_util/has_trivial_copy_assign/requirements/typedefs.cc:
	Likewise.
	* testsuite/20_util/has_trivial_copy_assign/value.cc: Likewise.
	* testsuite/20_util/has_trivial_copy_constructor/requirements/
	explicit_instantiation.cc: Likewise.
	* testsuite/20_util/has_trivial_copy_constructor/requirements/
	typedefs.cc: Likewise.
	* testsuite/20_util/has_trivial_copy_constructor/value.cc: Likewise.
	* testsuite/20_util/has_trivial_default_constructor/requirements/
	explicit_instantiation.cc: Likewise.
	* testsuite/20_util/has_trivial_default_constructor/requirements/
	typedefs.cc: Likewise.
	* testsuite/20_util/has_trivial_default_constructor/value.cc:
	Likewise.
	* testsuite/20_util/headers/type_traits/types_std_c++0x_neg.cc:
	Check has_trivial_default_constructor, has_trivial_copy_constructor,
	and has_trivial_copy_assign are not defined.
	* testsuite/20_util/pair/requirements/dr801.cc: Remove commented out
	tests.
	* testsuite/20_util/tuple/requirements/dr801.cc: Likewise.
	* testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Adjust
	dg-error line number.
	* testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc:
	Likewise.

From-SVN: r239079
2016-08-03 16:18:30 +01:00
Jonathan Wakely
589a30d1a4 Fix std::wstring allocator tests
* testsuite/21_strings/basic_string/allocator/wchar_t/copy.cc:
	Remove reundant check for _GLIBCXX_USE_WCHAR_T and fix char type.
	* testsuite/21_strings/basic_string/allocator/wchar_t/copy_assign.cc:
	Likewise.
	* testsuite/21_strings/basic_string/allocator/wchar_t/minimal.cc:
	Likewise.
	* testsuite/21_strings/basic_string/allocator/wchar_t/move.cc:
	Likewise.
	* testsuite/21_strings/basic_string/allocator/wchar_t/move_assign.cc:
	Likewise.
	* testsuite/21_strings/basic_string/allocator/wchar_t/noexcept.cc:
	Likewise.
	* testsuite/21_strings/basic_string/allocator/wchar_t/swap.cc:
	Likewise.

From-SVN: r238996
2016-08-02 20:34:36 +01:00
Jonathan Wakely
8bcd00bb13 Improve comments on check_v3_target_filesystem_ts
* testsuite/lib/libstdc++.exp (check_v3_target_filesystem_ts): Improve
	comments.

From-SVN: r238995
2016-08-02 20:34:30 +01:00