Commit Graph

7911 Commits

Author SHA1 Message Date
Jonathan Wakely b091b8dc0b PR78273 fix count to work with partitioning function
PR libstdc++/78273
	* include/bits/stl_map.h (map::count<_Kt>(const _Kt&)): Don't assume
	the heterogeneous comparison can only find one match.
	* include/bits/stl_set.h (set::count<_Kt>(const _Kt&)): Likewise.
	* testsuite/23_containers/map/operations/2.cc: Test count works with
	comparison function that just partitions rather than sorting.
	* testsuite/23_containers/set/operations/2.cc: Likewise.

From-SVN: r244317
2017-01-11 14:44:04 +00:00
Ville Voutilainen f3df0b3cde Reduce the size of variant, it doesn't need an index of type size_t internally.
Reduce the size of variant, it doesn't need an index of
type size_t internally.
* include/std/variant (parse_numbers.h): New include.
(__select_index): New.
(_Variant_storage<false, _Types...>::_M_reset_impl): Use
_index_type for comparison with variant_npos.
(_Variant_storage<false, _Types...>::__index_type): New.
(_Variant_storage<false, _Types...>::_M_index): Change the
type from size_t to __index_type.
(_Variant_storage<true, _Types...>::__index_type): New.
(_Variant_storage<true, _Types...>::_M_index): Change the
type from size_t to __index_type.
(_Variant_base::_M_valid): Use _Storage::__index_type
for comparison with variant_npos.
(variant::index): Use _Base::_Storage::__index_type
for comparison with variant_npos.
* testsuite/20_util/variant/index_type.cc: New.

From-SVN: r244309
2017-01-11 13:23:43 +02:00
Jonathan Wakely 904112f6bb Adjust effective target selector to fix C++17 FAIL
* testsuite/18_support/exception_ptr/60612-unexpected.cc: Adjust
	effective target selector to prevent running in C++17 mode.

From-SVN: r244280
2017-01-10 17:44:42 +00:00
Jonathan Wakely d2e1d4b713 PR77528 add default constructors for container adaptors
PR libstdc++/77528
	* include/bits/stl_queue.h (queue::c): Add default member initializer.
	(queue::queue()): Add constructor and define as defaulted.
	(queue::queue(_Sequence&&)): Remove default argument.
	(priority_queue::c, priority_queue::comp): Add default member
	initializers.
	(priority_queue::priority_queue()): Add constructor and define as
	defaulted.
	(priority_queue::priority_queue(const _Compare&, _Sequence&&)):
	Remove default argument for first parameter.
	* include/bits/stl_stack.h (stack::c): Add default member initializer.
	(stack::stack()): Add constructor and define as defaulted.
	(stack::stack(const _Sequence&)): Remove default argument.
	* testsuite/23_containers/priority_queue/requirements/
	explicit_instantiation/1.cc: Test explicit instantiation with
	non-DefaultConstructible sequence.
	* testsuite/23_containers/priority_queue/77528.cc: New test.
	* testsuite/23_containers/priority_queue/requirements/
	explicit_instantiation/1_c++0x.cc: Replace with 1_c++98.cc.
	* testsuite/23_containers/queue/77528.cc: New test.
	* testsuite/23_containers/queue/requirements/explicit_instantiation/
	1.cc: Test explicit instantiation with non-DefaultConstructible
	sequence.
	* testsuite/23_containers/queue/requirements/explicit_instantiation/
	1_c++0x.cc: Replace with 1_c++98.cc.
	* testsuite/23_containers/stack/77528.cc: New test.
	* testsuite/23_containers/stack/requirements/explicit_instantiation/
	1.cc: Test explicit instantiation with non-DefaultConstructible
	sequence.
	* testsuite/23_containers/stack/requirements/explicit_instantiation/
	1_c++0x.cc: Replace with 1_c++98.cc.

From-SVN: r244278
2017-01-10 17:30:20 +00:00
Felipe Magno de Almeida 26b67e383f Use temporary int objects to access struct tm members
Call _M_extract_* functions family through temporary int objects, so
it doesn't convert from lvalue to rvalue through a temporary in AVR
because of the incompatible types used in AVR-Libc.

This fixes compilation errors with AVR-Libc while compiling libstdc++
for AVR target.

2017-01-10  Felipe Magno de Almeida <felipe@expertisesolutions.com.br>

	* include/bits/locale_facets_nonio.tcc
	(time_get::_M_extract_via_format): Avoid compilation errors with
	non-standard struct tm.

From-SVN: r244271
2017-01-10 14:15:59 +00:00
François Dumont f9a27859df Make Python printers and xmethods work with versioned namespace
2017-01-10  François Dumont  <fdumont@gcc.gnu.org>
	    Jonathan Wakely  <jwakely@redhat.com>

	* python/libstdcxx/v6/printers.py (_versioned_namespace): Define.
	(is_specialization, strip_versioned_namespace): New helpers functions
	to work with symbols in the versioned namespace.
	(Printer.add_version): Add second name using versioned namespace.
	(add_one_template_type_printer, add_one_type_printer): Add second
	type printers using versioned namespace.
	(register_type_printers): Add template type printer for basic_string.
	(build_libstdcxx_dictionary): Remove dead code.
	* python/libstdcxx/v6/xmethods.py: Make all matchers look for
	versioned namespace.
	* testsuite/libstdc++-prettyprinters/48362.cc: Adjust expected
	results.
	* testsuite/libstdc++-prettyprinters/whatis.cc: Likewise.

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

From-SVN: r244262
2017-01-10 12:38:42 +00:00
Jonathan Wakely a7765de8ef PR79017 workaround incomplete C99 math on darwin
PR libstdc++/79017
	* acinclude.m4 (GLIBCXX_CHECK_C99_TR1): Check for llrint and llround
	functions separately on darwin and if they're missing define
	_GLIBCXX_NO_C99_ROUNDING_FUNCS.
	* config.h.in: Regenerate.
	* configure: Regenerate.
	* include/c_global/cmath [_GLIBCXX_NO_C99_ROUNDING_FUNCS] (llrint)
	(llrintf, llrintl, llround, llroundf, llroundl): Do not define.

From-SVN: r244231
2017-01-09 17:15:58 +00:00
Jonathan Wakely dc8bc65be3 Define testsuite macro for correct thread_local destructors
* testsuite/30_threads/condition_variable/members/3.cc: Use new macro
	to detect correct thread_local destructors.
	* testsuite/util/testsuite_hooks.h (CORRECT_THREAD_LOCAL_DTORS):
	Define.

From-SVN: r244226
2017-01-09 13:06:03 +00:00
Jonathan Wakely cb627cdf5c PR66414 optimize std::string::find
2017-01-09  Jonathan Wakely  <jwakely@redhat.com>
	    Aditya Kumar  <hiraditya@msn.com>

	PR libstdc++/66414
	* include/bits/basic_string.tcc
	(basic_string::find(const CharT*, size_type, size_type)): Optimize.

Co-Authored-By: Aditya Kumar <hiraditya@msn.com>

From-SVN: r244225
2017-01-09 13:05:58 +00:00
Jonathan Wakely 3330ac383c Add more tests for std::basic_string::find
* testsuite/21_strings/basic_string/operations/find/char/6.cc: New.
	* testsuite/21_strings/basic_string/operations/find/wchar_t/6.cc: New.

From-SVN: r244185
2017-01-06 21:22:40 +00:00
Jonathan Wakely 3907f9e59c Add missing <cassert> include to testcase
* testsuite/util/performance/priority_queue/mem_usage/pop_test.hpp:
	Include <cassert> header.

From-SVN: r244176
2017-01-06 17:51:24 +00:00
Jonathan Wakely ea4ad78e2c Check for __cxa_thread_atexit for freebsd crosses
PR libstdc++/78968
	* crossconfig.m4: Check for __cxa_thread_atexit on *-*-freebsd*.
	* configure: Regenerate.

From-SVN: r244169
2017-01-06 17:06:24 +00:00
Barrett Adair 258ee761eb Use fold expressions to reduce std::variant instantiation depth
2017-01-06  Barrett Adair  <barrettellisadair@gmail.com>
	    Jonathan Wakely  <jwakely@redhat.com>

	* include/std/variant (variant, swap): Replace __and_ usage with fold
	expressions.

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

From-SVN: r244163
2017-01-06 15:27:01 +00:00
Rainer Orth 1ec62aa9e1 Build libgo with -Wa,-nH if possible (PR go/78978) [non-libgo parts]
libstdc++-v3:
	PR go/78978
	* acinclude.m4 (GLIBCXX_CHECK_ASSEMBLER_HWCAP): Remove.
	* configure.ac: Call GCC_CHECK_ASSEMBLER_HWCAP instead of
	GLIBCXX_CHECK_ASSEMBLER_HWCAP.
	* fragment.am (CONFIG_CXXFLAGS): Use HWCAP_CFLAGS instead of
	HWCAP_FLAGS.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* Makefile.in, doc/Makefile.in, include/Makefile.in,
	libsupc++/Makefile.in, po/Makefile.in, python/Makefile.in,
	src/Makefile.in, src/c++11/Makefile.in, src/c++98/Makefile.in,
	src/filesystem/Makefile.in, testsuite/Makefile.in: Regenerate.

	config:
	PR go/78978
	* hwcaps.m4 (GCC_CHECK_ASSEMBLER_HWCAP): New macro.

From-SVN: r244162
2017-01-06 14:33:47 +00:00
Jonathan Wakely 8b790281d5 Don't redefine _GLIBCXX_ASSERTIONS if already defined
* include/bits/c++config (_GLIBCXX_ASSERTIONS): Avoid redefinition.

From-SVN: r244151
2017-01-06 12:34:11 +00:00
Jonathan Wakely 6807f08628 PR78991 make __gnu_cxx::__ops constructors explicit
PR libstdc++/78991
	* include/bits/predefined_ops.h (_Iter_comp_iter, _Iter_comp_val)
	(_Val_comp_iter, _Iter_equals_val, _Iter_pred, _Iter_comp_to_val)
	(_Iter_comp_to_iter, _Iter_negate): Make constructors explicit and
	move function objects.
	(__iter_comp_iter, __iter_comp_val, __val_comp_iter, __pred_iter)
	(__iter_comp_val, __iter_comp_iter, __negate): Move function objects.
	* testsuite/25_algorithms/sort/78991.cc: New test.

From-SVN: r244150
2017-01-06 12:33:58 +00:00
Jonathan Wakely 295ce2e534 Remove unnecessary typedef from std::function
* include/bits/std_function.h (function::_Signature_type): Remove.
	(function::function(_Functor)): Adjust.

From-SVN: r244107
2017-01-05 17:35:49 +00:00
Tim Shen 0f9cf7ff83 re PR libstdc++/78996 (<variant> uses macro as name)
2017-01-05  Tim Shen  <timshen@google.com>

	PR libstdc++/78996
	* include/std/variant (__gen_vtable_impl): rename __unused to
	__dimensions to avoid naming conflict.

From-SVN: r244092
2017-01-05 03:18:17 +00:00
Jonathan Wakely 2a792efe7f PR78968 add configure check for __cxa_thread_atexit in libc
PR libstdc++/78968
	* config.h.in: Regenerate.
	* configure: Likewise.
	* configure.ac: Check for __cxa_thread_atexit.
	* libsupc++/atexit_thread.cc [_GLIBCXX_HAVE___CXA_THREAD_ATEXIT]:
	Don't define __cxa_thread_atexit if libc provides it.

From-SVN: r244057
2017-01-04 15:41:19 +00:00
Ville Voutilainen 1308676957 Implement 2801, Default-constructibility of unique_ptr.
* include/bits/unique_ptr.h (__uniq_ptr_impl::_DeleterConstraint): New.
(unique_ptr::_DeleterConstraint): Likewise.
(unique_ptr()): Constrain.
(unique_ptr(pointer)): Likewise.
(unique_ptr(nullptr_t)): Likewise.
(unique_ptr<_Tp[], _Dp>::_DeleterConstraint): New.
(unique_ptr<_Tp[], _Dp>::unique_ptr()): Constrain.
(unique_ptr<_Tp[], _Dp>::unique_ptr(_Up)): Likewise.
(unique_ptr<_Tp[], _Dp>::unique_ptr(nullptr_t)): Likewise.
* testsuite/20_util/unique_ptr/assign/48635_neg.cc: Adjust.
* testsuite/20_util/unique_ptr/cons/cv_qual_neg.cc: Likewise.
* testsuite/20_util/unique_ptr/cons/default.cc: New.
* testsuite/20_util/unique_ptr/cons/ptr_deleter_neg.cc: Adjust.

From-SVN: r244054
2017-01-04 15:21:02 +02:00
Pauli Nieminen ed3cb49703 Support exception propagation without lock-free atomic int
2017-01-04  Pauli Nieminen  <suokkos@gmail.com>
	    Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/64735
	* acinclude.m4 (GLIBCXX_CHECK_EXCEPTION_PTR_SYMVER): Define.
	* config.h.in: Regenerate.
	* config/abi/pre/gnu.ver [HAVE_EXCEPTION_PTR_SINCE_GCC46]
	(GLIBCXX_3.4.15, GLIBCXX_3.4.21, CXXABI_1.3.3, CXXABI_1.3.5): Make
	exports for exception_ptr, nested_exception, and future conditional.
	[HAVE_EXCEPTION_PTR_SINCE_GCC46] (GLIBCXX_3.4.23, CXXABI_1.3.11): Add
	exports for exception_ptr, nested_exception, and future conditional.
	* configure: Regenerate.
	* configure.ac: Use GLIBCXX_CHECK_EXCEPTION_PTR_SYMVER.
	* include/std/future: Remove check for ATOMIC_INT_LOCK_FREE
	* libsupc++/eh_atomics.h: New file for internal use only.
	(__eh_atomic_inc, __eh_atomic_dec): New.
	* libsupc++/eh_ptr.cc (exception_ptr::_M_addref)
	(exception_ptr::_M_release) (__gxx_dependent_exception_cleanup)
	(rethrow_exception): Use eh_atomics.h reference counting helpers.
	* libsupc++/eh_throw.cc (__gxx_exception_cleanup): Likewise.
	* libsupc++/eh_tm.cc (free_any_cxa_exception): Likewise.
	* libsupc++/exception: Remove check for ATOMIC_INT_LOCK_FREE.
	* libsupc++/exception_ptr.h: Likewise.
	* libsupc++/guard.cc: Include header for ATOMIC_INT_LOCK_FREE macro.
	* libsupc++/nested_exception.cc: Remove check for
	ATOMIC_INT_LOCK_FREE.
	* libsupc++/nested_exception.h: Likewise.
	* src/c++11/future.cc: Likewise.
	* testsuite/18_support/exception_ptr/*: Remove atomic builtins checks.
	* testsuite/18_support/nested_exception/*: Likewise.
	* testsuite/30_threads/async/*: Likewise.
	* testsuite/30_threads/future/*: Likewise.
	* testsuite/30_threads/headers/future/types_std_c++0x.cc: Likewise.
	* testsuite/30_threads/packaged_task/*: Likewise.
	* testsuite/30_threads/promise/*: Likewise.
	* testsuite/30_threads/shared_future/*: Likewise.

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

From-SVN: r244051
2017-01-04 10:54:59 +00:00
Gerald Pfeifer c671a0d674 documentation_hacking.xml: sourceforge.net now defaults to https; adjust reference.
* doc/xml/manual/documentation_hacking.xml: sourceforge.net now
        defaults to https; adjust reference.

From-SVN: r244043
2017-01-04 02:33:08 +00:00
Jonathan Wakely 80efc5073d Add deleted std::thread(const thread&&) constructor
PR libstdc++/78956
	* include/std/thread (thread(const thread&&)): Add deleted
	constructor.
	* testsuite/30_threads/thread/cons/lwg2097.cc: New test.

From-SVN: r244022
2017-01-03 13:31:26 +00:00
Jonathan Wakely f61581f7a0 Fix typos in libstdc++ docs and update copyright years
* doc/xml/manual/spine.xml: Update copyright years.
	* doc/xml/manual/build_hacking.xml: Fix spelling of libbuilddir.
	* doc/xml/manual/test.xml: Likewise.
	* doc/html/*: Regenerate.

From-SVN: r244017
2017-01-03 11:16:31 +00:00
Gerald Pfeifer 337160b8ec faq.xml: Update address of C++ ABI link.
* doc/xml/faq.xml: Update address of C++ ABI link.
	* doc/xml/manual/abi.xml: Ditto.

From-SVN: r244001
2017-01-02 00:33:17 +00:00
Jakub Jelinek cbe34bb5ed Update copyright years.
From-SVN: r243994
2017-01-01 13:07:43 +01:00
Ville Voutilainen 2ae2d394c1 Implement LWG 2842, in_place_t check for optional::optional(U&&) should decay U.
Implement LWG 2842, in_place_t check for optional::optional(U&&)
should decay U.
* include/std/optional (_Optional_base(in_place_t, _Args&&...)):
Constrain.
(_Optional_base(in_place_t, initializer_list<_Up>, _Args&&...)):
Turn the int-pack constraint hack into a saner bool.
(_Optional_base<_Tp, false>::_Optional_base(in_place_t, _Args&&...)):
Constrain.
(_Optional_base<_Tp, false>::_Optional_base(in_place_t,
initializer_list<_Up>, _Args&&...)):
Turn the int-pack constraint hack into a saner bool.
(optional(_Up&&)): Constrain against in_place_t.
(optional(in_place_t, _Args&&...)): Constrain.
(constexpr optional(in_place_t, initializer_list<_Up>, _Args&&...)):
Turn the int-pack constraint hack into a saner bool.
* testsuite/20_util/optional/cons/value_neg.cc: Add a test for
a type that is constructible from in_place.

From-SVN: r243966
2016-12-29 21:19:59 +02:00
François Dumont 284a35df5d random.tcc: Fix usage of _OutputIteratorConcept.
2016-12-24  François Dumont  <fdumont@gcc.gnu.org>

	* include/ext/random.tcc: Fix usage of _OutputIteratorConcept.

From-SVN: r243915
2016-12-24 14:13:58 +00:00
Jason Merrill 31bfc9b9dd Implement P0522R0, matching of template template arguments.
gcc/c-family/
	* c.opt (-fnew-ttp-matching): New flag.
	* c-opts.c (c_common_post_options): Default on if -std=c++1z.
gcc/cp/
	* pt.c (coerce_template_template_parms): Allow a template argument
	that's less specialized than the parameter.
	(unify_bound_ttp_args): Adjust parm's args to apply to arg's
	template.
	(coerce_template_args_for_ttp): Split out from
	lookup_template_class_1.
	(coerce_ttp_args_for_tta, store_defaulted_ttp)
	(lookup_defaulted_ttp, add_defaults_to_ttp): New.
	(process_partial_specialization): Set DECL_CONTEXT of
	template template-parameters.
	(coerce_template_parms): Only inform when complain.
	(expand_template_argument_pack): Handle error_mark_node.
	(convert_template_argument, template_args_equal, unify): Handle
	any_targ_node.
	* cp-tree.h (enum cp_tree_index): Add CPTI_ANY_TARG.
	(any_targ_node): New.
	* decl.c (cxx_init_decl_processing): Set it.
	* name-lookup.c (consider_binding_level): Ignore names with embedded
	spaces.

From-SVN: r243871
2016-12-21 14:39:04 -05:00
Jason Merrill 57a6add274 Fix handling of explicit function template arguments with TTPs.
gcc/cp/
	* pt.c (coerce_template_parms): Consider variadic_args_p before
	complaining about too many template arguments.
libstdc++-v3/
	* testsuite/util/testsuite_tr1.h (test_property): Don't define both
	variadic and non-variadic overloads.

From-SVN: r243869
2016-12-21 14:38:44 -05:00
Jonathan Wakely e76d309851 PR 71444 define more error constants for mingw-w64
PR libstdc++/71444
	* config/os/mingw32-w64/error_constants.h
	(address_family_not_supported, address_in_use, address_not_available)
	(already_connected, connection_aborted, connection_already_in_progress)
	connection_refused, connection_reset, cross_device_link)
	(destination_address_required, host_unreachable, message_size)
	(network_down, network_reset, network_unreachable, no_buffer_space)
	(no_protocol_option, not_a_socket, not_connected, operation_canceled)
	(operation_in_progress, operation_not_supported, protocol_error)
	(protocol_not_supported, too_many_links, too_many_symbolic_link_levels)
	(value_too_large, wrong_protocol_type): Define.
	(bad_message, identifier_removed, no_link, no_message_available)
	(no_message, no_stream_resources, not_a_stream, owner_dead)
	(state_not_recoverable, stream_timeout, text_file_busy): Define
	conditionally.
	* testsuite/19_diagnostics/headers/system_error/errc_std_c++0x.cc:
	Guard test for no_message with _GLIBCXX_HAVE_ENOMSG.

From-SVN: r243853
2016-12-21 13:09:13 +00:00
Ville Voutilainen 4b21c3ea03 Make the perfect-forwarding constructor of a two-element tuple sfinae away when the first argument is an allocator_arg.
Make the perfect-forwarding constructor of a two-element tuple
sfinae away when the first argument is an allocator_arg.
* include/std/tuple (tuple(_U1&&, _U2&&)): Constrain.
* testsuite/20_util/tuple/cons/allocator_with_any.cc: New.
* testsuite/20_util/tuple/element_access/get_neg.cc: Adjust.

From-SVN: r243795
2016-12-19 14:55:33 +02:00
Jonathan Wakely f23e3d74a1 Reuse Doxygen comments for map::erase overloads
* include/bits/stl_map.h (map::erase(iterator)): Add Doxygen markup
	to reuse documentation for erase(const_iterator) overload.
	* include/bits/stl_multimap.h (multimap::erase(iterator)): Likewise.

From-SVN: r243758
2016-12-16 18:13:20 +00:00
Jonathan Wakely 36b8852641 Add assertion to _Rb_tree::erase to check for end iterators
* include/bits/stl_tree.h (_Rb_tree::_M_erase_aux(const_iterator)):
	Add assertion for undefined argument.
	(_Rb_tree::_M_erase_aux(const_iterator, const_iterator)): Call
	_M_erase_aux directly instead of through erase.
	(_Rb_tree::_M_erase_aux(const Key&)): Likewise.
	* testsuite/23_containers/map/modifiers/erase/end_neg.cc: New test.

From-SVN: r243757
2016-12-16 18:13:09 +00:00
Ville Voutilainen 6254952346 Implement LWG 2769, Redundant const in the return type of any_cast(const any&).
Implement LWG 2769, Redundant const in the return type of
any_cast(const any&).
* include/std/any (_AnyCast): New.
(any_cast(const any&)): Use it and add an explicit cast for return.
(any_cast(any&)): Likewise.
(any_cast(any&&)): Likewise.
* testsuite/20_util/any/misc/any_cast.cc: Add a test for a type
that has an explicit copy constructor.
*testsuite/20_util/any/misc/any_cast_neg.cc: Adjust.

From-SVN: r243739
2016-12-16 13:34:45 +02:00
Jonathan Wakely bdfc9f5c54 PR59170 make pretty printers check for singular iterators
PR libstdc++/59170
	* python/libstdcxx/v6/printers.py (StdListIteratorPrinter.to_string)
	(StdSlistIteratorPrinter.to_string, StdVectorIteratorPrinter.to_string)
	(StdRbtreeIteratorPrinter.to_string)
	(StdDequeIteratorPrinter.to_string): Add check for value-initialized
	iterators.
	* testsuite/libstdc++-prettyprinters/simple.cc: Test them.
	* testsuite/libstdc++-prettyprinters/simple11.cc: Likewise.

From-SVN: r243692
2016-12-15 14:13:36 +00:00
Jonathan Wakely 50a8a9413d PR59161 make pretty printers always return strings
PR libstdc++/59161
	* python/libstdcxx/v6/printers.py (StdListIteratorPrinter.to_string)
	(StdSlistIteratorPrinter.to_string, StdVectorIteratorPrinter.to_string)
	(StdRbtreeIteratorPrinter.to_string, StdDequeIteratorPrinter.to_string)
	(StdDebugIteratorPrinter.to_string): Return string instead of
	gdb.Value.
	* testsuite/libstdc++-prettyprinters/59161.cc: New test.

From-SVN: r243690
2016-12-15 13:25:22 +00:00
Jonathan Wakely 7224c6a997 Tweak formatting and docs for pretty printers
* python/libstdcxx/v6/printers.py (UniquePointerPrinter.to_string):
	Remove redundant parentheses.
	(RbtreeIterator, StdRbtreeIteratorPrinter): Add docstrings.
	(StdForwardListPrinter.to_string): Remove redundant parentheses.
	(StdExpOptionalPrinter.to_string): Use string formatting instead of
	concatenation.
	(StdVariantPrinter.to_string, StdNodeHandlePrinter.to_string)
	(TemplateTypePrinter): Adjust whitespace.

From-SVN: r243689
2016-12-15 12:45:47 +00:00
Jonathan Wakely 0376e86bfc Add GDB XMethods for shared_ptr and unique_ptr<T[]>
* python/libstdcxx/v6/xmethods.py (UniquePtrGetWorker.__init__): Use
	correct element type for unique_ptr<T[]>.
	(UniquePtrGetWorker._supports, UniquePtrDerefWorker._supports): New
	functions to disable unsupported operators for unique_ptr<T[]>.
	(UniquePtrSubscriptWorker): New worker for operator[].
	(UniquePtrMethodsMatcher.__init__): Register UniquePtrSubscriptWorker.
	(UniquePtrMethodsMatcher.match): Call _supports on the chosen worker.
	(SharedPtrGetWorker, SharedPtrDerefWorker, SharedPtrSubscriptWorker)
	(SharedPtrUseCountWorker, SharedPtrUniqueWorker): New workers.
	(SharedPtrMethodsMatcher): New matcher for shared_ptr.
	(register_libstdcxx_xmethods): Register SharedPtrMethodsMatcher.
	* testsuite/libstdc++-xmethods/unique_ptr.cc: Test arrays.
	* testsuite/libstdc++-xmethods/shared_ptr.cc: New test.

From-SVN: r243688
2016-12-15 12:45:42 +00:00
François Dumont b958889311 stl_tree.h (_Rb_tree_impl(const _Key_compare&, const _Node_allocator&): Restore before C++11 mode.
2016-12-14  François Dumont  <fdumont@gcc.gnu.org>

	* include/bits/stl_tree.h
	(_Rb_tree_impl(const _Key_compare&, const _Node_allocator&): Restore
	before C++11 mode.

From-SVN: r243670
2016-12-14 20:50:07 +00:00
Jonathan Wakely d33c00e1ce Make printers use singular noun for a single element
* python/libstdcxx/v6/printers.py (num_elements): New function.
	(StdMapPrinter.to_string, StdSetPrinter.to_string)
	(StdDequePrinter.to_string, Tr1UnorderedSetPrinter.to_string)
	(Tr1UnorderedMapPrinter.to_string): Use num_elements.
	* testsuite/libstdc++-prettyprinters/cxx11.cc: Adjust expected results
	to use singular noun when there is only one element.
	* testsuite/libstdc++-prettyprinters/debug.cc: Likewise.
	* testsuite/libstdc++-prettyprinters/debug_cxx11.cc: Likewise.
	* testsuite/libstdc++-prettyprinters/simple.cc: Likewise.
	* testsuite/libstdc++-prettyprinters/simple11.cc: Likewise.
	* testsuite/libstdc++-prettyprinters/tr1.cc: Likewise.

From-SVN: r243652
2016-12-14 16:07:29 +00:00
Jonathan Wakely 3c760f4a79 Make printers detect invalid debug mode iterators
PR libstdc++/59170
	* python/libstdcxx/v6/printers.py (StdDebugIteratorPrinter): Use
	_M_sequence and _M_version to detect invalid iterators.
	* testsuite/libstdc++-prettyprinters/debug.cc: Test debug mode vector
	and test invalid iterators.
	* testsuite/libstdc++-prettyprinters/debug_cxx11.cc: New test.

From-SVN: r243650
2016-12-14 15:17:57 +00:00
Kyrylo Tkachov 39c429372b [libstdc++][testsuite] XFAIL tests relying on long double-to-string conversions on broken newlib
* lib/target-supports.exp
    (check_effective_target_newlib_broken_long_double_io): New check.
    (check_effective_target_frexpl): Likewise.

    * testsuite/21_strings/basic_string/numeric_conversions/char/stod.cc:
    XFAIL run if newlib_broken_long_double_io.
    * testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stod.cc:
    Likewise.
    * testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stold.cc:
    Likewise.
    * testsuite/27_io/basic_ostream/inserters_arithmetic/char/hexfloat.cc:
    Likewise.

From-SVN: r243558
2016-12-12 15:47:47 +00:00
Jonathan Wakely 1c43384234 Remove stray character at end of dg-do directive
* testsuite/experimental/filesystem/operations/is_empty.cc:
	Remove stray character at end of dg-do directive.

From-SVN: r243555
2016-12-12 14:32:23 +00:00
Jonathan Wakely 8152d6eff6 Remove stray character at end of dg-do directive
* testsuite/experimental/filesystem/operations/temp_directory_path.cc:
	Remove stray character at end of dg-do directive.

From-SVN: r243548
2016-12-12 12:44:46 +00:00
Jonathan Wakely 9b796223a3 Fix std::variant for gnu-versioned--namespace build
* include/std/variant: Remove misplaced
	_GLIBCXX_BEGIN_NAMESPACE_VERSION macro.

From-SVN: r243489
2016-12-09 15:22:01 +00:00
David Edelsohn 410aa8982f parallel_algorithm_assert2.cc: Move dg-do run first.
* testsuite/25_algorithms/headers/algorithm/
        parallel_algorithm_assert2.cc: Move dg-do run first.

From-SVN: r243468
2016-12-08 17:35:24 -05:00
Eric Botcazou 0a7577bbac re PR libstdc++/78264 (ICE in build_noexcept_spec, at cp/except.c:1196)
PR libstdc++/78264
	* include/bits/c++config (_GLIBCXX_NOEXCEPT_PARM): Turn _N into _NE.
	(_GLIBCXX_NOEXCEPT_QUAL): Likewise.

From-SVN: r243443
2016-12-08 15:52:11 +00:00
Jonathan Wakely fdb0b271e8 Fix filesystem test that fails in debug mode
* testsuite/experimental/filesystem/path/construct/range.cc: Don't
	use basic_string::front() when string might be empty.

From-SVN: r243438
2016-12-08 13:25:09 +00:00
Jonathan Wakely 1d752b4fee Delete std::swap for debug mode array
* include/debug/array (swap): Add deleted overload.
	* include/bits/stl_pair.h (swap): Remove redundant inline keyword
	from deleted overload.
	* include/bits/unique_ptr.h (swap): Likewise.
	* include/std/array (swap): Likewise.
	* include/std/optional (swap): Likewise.
	* include/std/tuple (swap): Likewise.
	* include/std/variant (swap): Likewise.
	* testsuite/23_containers/array/tuple_interface/get_debug_neg.cc:
	Adjust dg-error line numbers.
	* testsuite/23_containers/array/tuple_interface/get_neg.cc: Likewise.
	* testsuite/23_containers/array/tuple_interface/
	tuple_element_debug_neg.cc: Likewise.
	* testsuite/23_containers/array/tuple_interface/tuple_element_neg.cc:
	Likewise.

From-SVN: r243437
2016-12-08 13:25:03 +00:00