Commit Graph

581 Commits

Author SHA1 Message Date
Jonathan Wakely 3228289e1e PR libstdc++/90682 allow set_terminate(0) and set_unexpected(0)
Make these functions restore the default handlers when passed a null
pointer. This is consistent with std::pmr::set_default_resource(0), and
also matches the current behaviour of libc++.

In order to avoid duplicating the preprocessor condition from
eh_term_handler.cc more that into a new eh_term_handler.h header and
define a macro that can be used in both eh_term_handler.cc and
eh_terminate.cc.

	PR libstdc++/90682
	* libsupc++/eh_term_handler.cc: Include eh_term_handler.h to get
	definition of _GLIBCXX_DEFAULT_TERM_HANDLER.
	* libsupc++/eh_term_handler.h: New header defining
	_GLIBCXX_DEFAULT_TERM_HANDLER.
	* libsupc++/eh_terminate.cc: Include eh_term_handler.h.
	(set_terminate): Restore default handler when argument is null.
	(set_unexpected): Likewise.
	* testsuite/18_support/set_terminate.cc: New test.
	* testsuite/18_support/set_unexpected.cc: New test.

From-SVN: r271808
2019-05-31 11:35:11 +01:00
Rainer Orth ccd1242eec Remove obsolete Solaris 10 support
libstdc++-v3:
	* config/os/solaris/solaris2.10: Move to ...
	* config/os/solaris: ... this.
	* configure.host (os_include_dir): Adapt.
	(abi_baseline_pair): Remove Solaris 10 handling.
	* config/abi/post/i386-solaris2.10: Remove.
	* config/abi/post/sparc-solaris2.10: Remove.
	* config/abi/post/i386-solaris2.11: Rename to ...
	* config/abi/post/i386-solaris: ... this.
	* config/abi/post/sparc-solaris2.11: Rename to ...
	* config/abi/post/sparc-solaris: ... this.

	* libsupc++/new_opa.cc [_GLIBCXX_HAVE_MEMALIGN] [__sun]: Remove
	workaround.

	* testsuite/ext/enc_filebuf/char/13598.cc: Remove *-*-solaris2.10
	xfail.

	libsanitizer:
	* configure.ac (have_dl_iterate_phdr): Remove *-*-solaris2.10*
	handling.
	* configure: Regenerate.

	libgcc:
	* config.host: Simplify various *-*-solaris2.1[0-9]* to
	*-*-solaris2*.
	* configure.ac: Likewise.
	* configure: Regenerate.

	* config/i386/sol2-unwind.h (x86_fallback_frame_state): Remove
	Solaris 10 and Solaris 11 < snv_125 handling.

	libbacktrace:
	* configure.ac (have_dl_iterate_phdr): Remove *-*-solaris2.10*
	handling.
	* configure: Regenerate.

	gcc/testsuite:
	* gcc.dg/atomic/c11-atomic-exec-4.c: Simplify triplet to
	*-*-solaris2*.
	* gcc.dg/atomic/c11-atomic-exec-5.c: Likewise.
	* gcc.dg/c99-math-double-1.c: Likewise.
	* gcc.dg/c99-math-float-1.c: Likewise.
	* gcc.dg/c99-math-long-double-1.c: Likewise.
	* gcc.misc-tests/linkage.exp: Simplify triplet to
	x86_64-*-solaris2*.

	* gcc.target/i386/mcount_pic.c: Remove *-*-solaris2.10* && !gld
	xfail.
	* gcc.target/i386/pr63620.c: Likewise.

	* lib/target-supports.exp (check_sse_os_support_available): Remove
	Solaris 9/x86 workaround.

	gcc:
	* config.gcc: Move *-*-solaris2.10* from obsolete configurations
	to unsupported ones.
	Simplify x86_64-*-solaris2.1[0-9]* to x86_64-*-solaris2*.
	* config.host: Likewise.
	* config/i386/sol2.h (ASM_COMMENT_START): Remove.
	* config/sparc/driver-sparc.c (host_detect_local_cpu) [__sun__ &&
	__svr4__]: Remove "brand" fallback.
	[!KSTAT_DATA_STRING]: Remove.
	* configure.ac (gcc_cv_ld_hidden): Simplify *-*-solaris2.1[0-9]*
	to *-*-solaris2*.
	(comdat_group): Likewise.
	(set_have_as_tls): Likewise.
	(gcc_cv_target_dl_iterate_phdr): Likewise.
	(gcc_cv_as_shf_merge): Remove Solaris 10/x86 workaround.
	(gcc_cv_ld_aligned_shf_merge): Remove Solaris 10/SPARC workaround.
	* configure: Regenerate.
	* doc/install.texi: Simplify Solaris target triplets.
	(Specific, i?86-*-solaris2*): Remove Solaris 10 references.
	(Specific, *-*-solaris2*): Document Solaris 10 removal.
	Remove Solaris 10 references.
	Remove obsolete Solaris bug reference.
	(Specific, sparc-sun-solaris2.10): Remove.

From-SVN: r271183
2019-05-14 17:17:23 +00:00
Jonathan Wakely 302b699607 Improve API docs for <memory> and <new>
* include/bits/shared_ptr.h: Improve docs.
	* include/bits/shared_ptr_base.h: Likewise.
	* include/bits/stl_uninitialized.h: Likewise.
	* include/bits/unique_ptr.h: Likewise.
	* libsupc++/new: Likewise.

From-SVN: r271077
2019-05-10 22:41:11 +01:00
Jonathan Wakely 2f7f1aca29 Improve API docs for <system_error> header
* include/std/system_error (error_category, error_code)
	(error_condition): Improve docs.
	* libsupc++/exception: Add missing @addtogroup Doxygen command.
	* libsupc++/exception_ptr.h (exception_ptr): Link equality operators
	to class documentation. Suppress documentation for implementation
	details.
	* libsupc++/nested_exception.h (throw_with_nested, rethrow_if_nested):
	Suppress documentation for implementation details.

From-SVN: r270873
2019-05-04 15:35:29 +01:00
Jonathan Wakely 8c6a71e47c Miscellaneous API doc improvements
* include/bits/basic_string.h: Fix iterator/index confusion in
	Doxygen comments.
	* include/bits/range_access.h: Fix Doxygen warnings.
	* include/bits/refwrap.h: Do not document implementation details.
	(ref, cref): Group docs with reference_wrapper.
	* include/std/fstream: Fix Doxygen markup.
	* libsupc++/initializer_list (begin, end): Group docs with
	initializer_list.

From-SVN: r270814
2019-05-02 16:46:50 +01:00
Ramana Radhakrishnan 48528842bd re PR target/89093 (C++ exception handling clobbers d8 VFP register)
PR target/89093
	* config/arm/arm.c (aapcs_vfp_is_call_or_return_candidate): Diagnose
	if used with general-regs-only.
	(arm_conditional_register_usage): Don't add non-general regs if
	general-regs-only.
	(arm_valid_target_attribute_rec): Handle general-regs-only.
	* config/arm/arm.h (TARGET_HARD_FLOAT): Return false if
	general-regs-only.
	(TARGET_HARD_FLOAT_SUB): Define.
	(TARGET_SOFT_FLOAT): Define as negation of TARGET_HARD_FLOAT_SUB.
	(TARGET_REALLY_IWMMXT): Add && !TARGET_GENERAL_REGS_ONLY.
	(TARGET_REALLY_IWMMXT2): Likewise.
	* config/arm/arm.opt: Add -mgeneral-regs-only.
	* doc/extend.texi: Document ARM general-regs-only target.
	* doc/invoke.texi: Document ARM -mgeneral-regs-only.
libgcc/
	* config/arm/pr-support.c: Add #pragma GCC target("general-regs-only").
	* config/arm/unwind-arm.c: Likewise.
	* unwind-c.c (PERSONALITY_FUNCTION): Add general-regs-only target
	attribute for ARM.
libobjc/
	* exception.c (PERSONALITY_FUNCTION): Add general-regs-only target
	attribute for ARM.
libphobos/
	* libdruntime/gcc/deh.d: Import gcc.attribute.
	(personality_fn_attributes): New enum.
	(scanLSDA, CONTINUE_UNWINDING, gdc_personality, __gdc_personality):
	Add @personality_fn_attributes.
libstdc++-v3/
	* libsupc++/eh_personality.cc (PERSONALITY_FUNCTION): Add
	general-regs-only target attribute for ARM.

Co-Authored-By: Bernd Edlinger <bernd.edlinger@hotmail.de>
Co-Authored-By: Jakub Jelinek <jakub@redhat.com>

From-SVN: r270504
2019-04-23 12:03:41 +02:00
Jonathan Wakely 1a823c9ae9 PR libstdc++/89629 fix _Hash_bytes for lengths > INT_MAX
PR libstdc++/89629
	* libsupc++/hash_bytes.cc [__SIZEOF_SIZE_T__ == 8] (_Hash_bytes):
	Use correct type for len_aligned.
	* testsuite/20_util/hash/89629.cc: New test.

From-SVN: r269584
2019-03-11 13:46:05 +00:00
Jonathan Wakely a4395a846a PR libstdc++/89466 avoid slow xsltproc command in configure
Certain broken versions of xsltproc ignore the --nonet option and will
attempt to fetch the docbook stylesheet from the WWW when it isn't in
the local XML catalog.

This patch checks for the local stylesheet directory first, and doesn't
use xsltproc if no local stylesheets are found. Checking for the local
directory is done using xmlcatalog if available, only checking the
hardcoded list of directories if xmlcatalog fails. The right directory
for Suse is added to the hardcoded list.

This should avoid doing an xsltproc check that would need to download
the stylesheet, so no network connection is made even if a broken
xsltproc is present.

	PR libstdc++/89466
	* acinclude.m4 (GLIBCXX_CONFIGURE_DOCBOOK): Reorder check for local
	stylesheet directories before check for xsltproc. Try to use
	xmlcatalog to find local stylesheet directory before trying hardcoded
	paths. Add path used by suse to hardcoded paths. Adjust xsltproc
	check to look for the same stylesheet as doc/Makefile.am uses. Don't
	use xsltproc if xmlcatalog fails to find a local stylesheet.
	* configure.ac: Check for xmlcatalog.
	* Makefile.in: Regenerate.
	* configure: Likewise.
	* doc/Makefile.in: Likewise.
	* include/Makefile.in: Likewise.
	* libsupc++/Makefile.in: Likewise.
	* po/Makefile.in: Likewise.
	* python/Makefile.in: Likewise.
	* src/Makefile.in: Likewise.
	* src/c++11/Makefile.in: Likewise.
	* src/c++17/Makefile.in: Likewise.
	* src/c++98/Makefile.in: Likewise.
	* src/filesystem/Makefile.in: Likewise.
	* testsuite/Makefile.in: Likewise.

From-SVN: r269249
2019-02-27 11:25:44 +00:00
Tom Honermann c124af936b P0482R5 char8_t: Standard library support
gcc/cp:

2019-02-19  Tom Honermann  <tom@honermann.net>

	* name-lookup.c (get_std_name_hint): Added u8string as a name hint.

libstdc++:

2019-02-19  Tom Honermann  <tom@honermann.net>

	P0482R5 char8_t: Standard library support
	* config/abi/pre/gnu-versioned-namespace.ver (CXXABI_2.0): Add
	typeinfo symbols for char8_t.
	* config/abi/pre/gnu.ver: Add CXXABI_1.3.12.
	(GLIBCXX_3.4.26): Add symbols for specializations of
	numeric_limits and codecvt that involve char8_t.
	(CXXABI_1.3.12): Add typeinfo symbols for char8_t.
	* include/bits/atomic_base.h: Add atomic_char8_t.
	* include/bits/basic_string.h: Add std::hash<u8string> and
	operator""s(const char8_t*, size_t).
	* include/bits/c++config: Define _GLIBCXX_USE_CHAR8_T and
	__cpp_lib_char8_t.
	* include/bits/char_traits.h: Add char_traits<char8_t>.
	* include/bits/codecvt.h: Add
	codecvt<char16_t, char8_t, mbstate_t>,
	codecvt<char32_t, char8_t, mbstate_t>,
	codecvt_byname<char16_t, char8_t, mbstate_t>, and
	codecvt_byname<char32_t, char8_t, mbstate_t>.
	* include/bits/cpp_type_traits.h: Add __is_integer<char8_t> to
	recognize char8_t as an integral type.
	* include/bits/fs_path.h: (path::__is_encoded_char): Recognize
	char8_t.
	(path::u8string): Return std::u8string when char8_t support is
	enabled.
	(path::generic_u8string): Likewise.
	(path::_S_convert): Handle conversion from char8_t input.
	(path::_S_str_convert): Likewise.
	* include/bits/functional_hash.h: Add hash<char8_t>.
	* include/bits/locale_conv.h (__str_codecvt_out): Add overloads for
	char8_t.
	* include/bits/locale_facets.h (_GLIBCXX_NUM_UNICODE_FACETS): Bump
	for new char8_t specializations.
	* include/bits/localefwd.h: Add missing declarations of
	codecvt<char16_t, char, mbstate_t> and
	codecvt<char32_t, char, mbstate_t>.  Add char8_t declarations
	codecvt<char16_t, char8_t, mbstate_t> and
	codecvt<char32_t, char8_t, mbstate_t>.
	* include/bits/postypes.h: Add u8streampos
	* include/bits/stringfwd.h: Add declarations of
	char_traits<char8_t> and u8string.
	* include/c_global/cstddef: Add __byte_operand<char8_t>.
	* include/experimental/bits/fs_path.h (path::__is_encoded_char):
	Recognize char8_t.
	(path::u8string): Return std::u8string when char8_t support is
	enabled.
	(path::generic_u8string): Likewise.
	(path::_S_convert): Handle conversion from char8_t input.
	(path::_S_str_convert): Likewise.
	* include/experimental/string: Add u8string.
	* include/experimental/string_view: Add u8string_view,
	hash<experimental::u8string_view>, and
	operator""sv(const char8_t*, size_t).
	* include/std/atomic: Add atomic<char8_t> and atomic_char8_t.
	* include/std/charconv (__is_int_to_chars_type): Recognize char8_t
	as a character type.
	* include/std/limits: Add numeric_limits<char8_t>.
	* include/std/string_view: Add u8string_view,
	hash<experimental::u8string_view>, and
	operator""sv(const char8_t*, size_t).
	* include/std/type_traits: Add __is_integral_helper<char8_t>,
	__make_unsigned<char8_t>, and __make_signed<char8_t>.
	* libsupc++/atomic_lockfree_defines.h: Define
	ATOMIC_CHAR8_T_LOCK_FREE.
	* src/c++11/Makefile.am: Compile with -fchar8_t when compiling
	codecvt.cc and limits.cc so that char8_t specializations of
	numeric_limits and codecvt and emitted.
	* src/c++11/Makefile.in: Likewise.
	* src/c++11/codecvt.cc: Define members of
	codecvt<char16_t, char8_t, mbstate_t>,
	codecvt<char32_t, char8_t, mbstate_t>,
	codecvt_byname<char16_t, char8_t, mbstate_t>, and
	codecvt_byname<char32_t, char8_t, mbstate_t>.
	* src/c++11/limits.cc: Define members of
	numeric_limits<char8_t>.
	* src/c++98/Makefile.am: Compile with -fchar8_t when compiling
	locale_init.cc and localename.cc.
	* src/c++98/Makefile.in: Likewise.
	* src/c++98/locale_init.cc: Add initialization for the
	codecvt<char16_t, char8_t, mbstate_t> and
	codecvt<char32_t, char8_t, mbstate_t> facets.
	* src/c++98/localename.cc: Likewise.
	* testsuite/util/testsuite_abi.cc: Validate ABI bump.

From-SVN: r269004
2019-02-19 02:54:42 +00:00
Jonathan Wakely 329c0f891a PR libstdc++/89345 Only define std::destroying_delete for C++2a
Clang defines the __cpp_impl_destroying_delete macro unconditionally, so
that the feature is supported whenever the library type is defined. This
is incompatible with the current definition in libstdc++ because we use
constexpr and inline variables, which will give an error for older -std
modes.

This patch defines the destroying_delete_t type and destroying_delete
variable independently of the __cpp_impl_destroying_delete macro, but
only for C++2a (because the names aren't reserved for previous
standards). The __cpp_lib_destroying_delete macro is only defined when
both the library type and compiler macro are defined (i.e. when the type
can actually be used as intended).

	PR libstdc++/89345
	* include/std/version [__cpp_impl_destroying_delete]
	(__cpp_lib_destroying_delete): Only define for C++2a and later.
	* libsupc++/new [__cpp_impl_destroying_delete]
	(__cpp_lib_destroying_delete): Likewise.
	(destroying_delete_t, destroying_delete): Likewise, but define even
	when __cpp_impl_destroying_delete is not defined.
	* testsuite/18_support/destroying_delete.cc: New test.

From-SVN: r268856
2019-02-13 22:13:45 +00:00
Ulrich Drepper d715f55431 Fix after P0600.
gcc/testsuite/ChangeLog
2019-02-20  Ulrich Drepper  <drepper@redhat.com>

	Fix after P0600.
	* g++.dg/init/new39.C: Don't just ignore result of new.

libstdc++/ChangeLog
2019-02-20  Ulrich Drepper  <drepper@redhat.com>

	Implement C++20 P0600r1.
	* include/backward/hash_map: Add nodiscard attribute to empty.
	* include/backward/hash_set: Likewise.
	* backward/hashtable.h: Likewise.
	* include/bits/basic_string.h: Likewise.
	* include/bits/forward_list.h: Likewise.
	* include/bits/hashtable.h: Likewise.
	* include/bits/regex.h: Likewise.
	* include/bits/stl_deque.h: Likewise.
	* include/bits/stl_list.h: Likewise.
	* include/bits/stl_map.h: Likewise.
	* include/bits/stl_multimap.h: Likewise.
	* include/bits/stl_multiset.h: Likewise.
	* include/bits/stl_queue.h: Likewise.
	* include/bits/stl_set.h: Likewise.
	* include/bits/stl_stack.h: Likewise.
	* include/bits/stl_tree.h: Likewise.
	* include/bits/stl_vector.h: Likewise.
	* include/bits/unordered_map.h: Likewise.
	* include/bits/unordered_set.h: Likewise.
	* include/debug/array: Likewise.
	* include/experimental/any: Likewise.
	* include/experimental/bits/fs_path.h: Likewise.
	* include/experimental/internet: Likewise.
	* include/experimental/string_view: Likewise.
	* include/ext/pb_ds/detail/bin_search_tree_/info_fn_imps.hpp:
	Likewise.
	* include/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp:
	Likewise.
	* include/ext/pb_ds/detail/binary_heap_/info_fn_imps.hpp:
	Likewise.
	* include/ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp:
	Likewise.
	* include/ext/pb_ds/detail/cc_hash_table_map_/info_fn_imps.hpp:
	Likewise.
	* include/ext/pb_ds/detail/cc_hash_table_map_/size_fn_imps.hpp:
	Likewise.
	* include/ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp:
	Likewise.
	* include/ext/pb_ds/detail/gp_hash_table_map_/info_fn_imps.hpp:
	Likewise.
	* include/ext/pb_ds/detail/left_child_next_sibling_heap_/info_fn_imps.hpp:
	Likewise.
	*
include/ext/pb_ds/detail/left_child_next_sibling_heap_/left_child_next_sibling_heap_.hpp:
	Likewise.
	* include/ext/pb_ds/detail/list_update_map_/info_fn_imps.hpp:
	Likewise.
	* include/ext/pb_ds/detail/list_update_map_/lu_map_.hpp:
	Likewise.
	* include/ext/pb_ds/detail/ov_tree_map_/info_fn_imps.hpp:
	Likewise.
	* include/ext/pb_ds/detail/ov_tree_map_/ov_tree_map_.hp:
	Likewise.
	* include/ext/pb_ds/detail/pat_trie_/info_fn_imps.hpp:
	Likewise.
	* include/ext/pb_ds/detail/pat_trie_/pat_trie_.hpp:
	Likewise.
	* include/ext/pb_ds/detail/rc_binomial_heap_/rc.hpp:
	Likewise.
	* include/ext/pb_ds/detail/tree_trace_base.hpp: Likewise.
	* include/ext/pb_ds/trie_policy.hpp: Likewise.
	* include/ext/rope: Likewise.
	* include/ext/slist: Likewise.
	* include/ext/vstring.h: Likewise.
	* include/profile/array: Likewise.
	* include/std/array: Likewise.
	* include/tr1/array: Likewise.
	* include/tr1/hashtable.h: Likewise.
	* include/tr1/regex: Likewise.
	* include/tr2/dynamic_bitset: Likewise.
	* include/bits/alloc_traits.h: Add nodiscard attribute to
	allocate.
	* include/experimental/memory_resource: Likewise.
	* include/ext/alloc_traits.h: Likewise.
	* include/ext/array_allocator.h: Likewise.
	* include/ext/bitmap_allocator.h: Likewise.
	* include/ext/debug_allocator.h: Likewise.
	* include/ext/extptr_allocator.h: Likewise.
	* include/ext/mt_allocator.h: Likewise.
	* include/ext/new_allocator.h: Likewise.
	* include/ext/pool_allocator.h: Likewise.
	* include/ext/throw_allocator.h: Likewise.
	* include/std/scoped_allocator: Likewise.
	* libsupc++/eh_alloc.cc: Likewise.
	* include/std/future: Add nodiscard attribute to async.
	* libsupc++/new: Add nodiscard attribute to new.

From-SVN: r268111
2019-01-21 11:47:30 +00:00
Jonathan Wakely 56a9eaf9ab Fix missing or incorrect feature test macros
* doc/xml/manual/status_cxx2017.xml: Document P0032R3 and P0307R2
	status.
	* include/bits/stl_uninitialized.h (__cpp_lib_raw_memory_algorithms):
	Define.
	* include/std/any (__cpp_lib_any): Define as 201606L, because P0032R3
	changes are supported.
	* include/std/optional (__cpp_lib_optional): Likewise.
	* include/std/variant (__cpp_lib_variant): Likewise.
	* include/std/version [!__STRICT_ANSI__]
	(__cpp_lib_uncaught_exceptions): Define as long integer.
	[__cplusplus >= 201703L] (__cpp_lib_any)
	(__cpp_lib_raw_memory_algorithms, __cpp_lib_uncaught_exceptions)
	(__cpp_lib_variant): Define for C++17.
	[__cplusplus >= 201703L] (__cpp_lib_optional): Update value and define
	as long integer.
	* libsupc++/exception (__cpp_lib_uncaught_exceptions): Define as long
	integer.

From-SVN: r267936
2019-01-15 12:01:12 +00:00
Jakub Jelinek a554497024 Update copyright years.
From-SVN: r267494
2019-01-01 13:31:55 +01:00
Jason Merrill a6bb6b07f7 Implement P0722R3, destroying operator delete.
A destroying operator delete takes responsibility for calling the destructor
for the object it is deleting; this is intended to be useful for sized
delete of a class allocated with a trailing buffer, where the compiler can't
know the size of the allocation, and so would pass the wrong size to the
non-destroying sized operator delete.

gcc/c-family/
	* c-cppbuiltin.c (c_cpp_builtins): Define
	__cpp_impl_destroying_delete.
gcc/cp/
	* call.c (std_destroying_delete_t_p, destroying_delete_p): New.
	(aligned_deallocation_fn_p, usual_deallocation_fn_p): Use
	destroying_delete_p.
	(build_op_delete_call): Handle destroying delete.
	* decl2.c (coerce_delete_type): Handle destroying delete.
	* init.c (build_delete): Don't call dtor with destroying delete.
	* optimize.c (build_delete_destructor_body): Likewise.
libstdc++-v3/
	* libsupc++/new (std::destroying_delete_t): New.

From-SVN: r266053
2018-11-12 23:40:01 -05:00
Joseph Myers 22e0527251 Update GCC to autoconf 2.69, automake 1.15.1 (PR bootstrap/82856).
This patch updates GCC to use autoconf 2.69 and automake 1.15.1.
(That's not the latest automake version, but it's the one used by
binutils-gdb, with which consistency is desirable, and in any case
seems a useful incremental update that should make a future update to
1.16.1 easier.)

The changes are generally similar to the binutils-gdb ones, and are
copied from there where shared files and directories are involved
(there are some further changes to such shared directories, however,
which I'd expect to apply to binutils-gdb once this patch is in GCC).
Largely, obsolete AC_PREREQ calls are removed, while many
AC_LANG_SOURCE calls are added to avoid warnings from aclocal and
autoconf.  Multilib support is no longer included in core automake,
meaning that multilib.am needs copying from automake's contrib
directory into the GCC source tree.  Autoconf 2.69 has Go support, so
local copies of that support are removed.  I hope the D support will
soon be submitted to upstream autoconf so the local copy of that can
be removed in a future update.  Changes to how automake generates
runtest calls mean quotes are removed from RUNTEST definitions in five
lib*/testsuite/Makefile.am files (libatomic, libgomp, libitm,
libphobos, libvtv; some others have RUNTEST definitions without
quotes, which are still OK); libgo and libphobos also get
-Wno-override added to AM_INIT_AUTOMAKE so those overrides of RUNTEST
do not generate automake warnings.

Note that the regeneration did not include regeneration of
fixincludes/config.h.in (attempting such regeneration resulted in all
the USED_FOR_TARGET conditionals disappearing; and I don't see
anything in the fixincludes/ directory that would result in such
conditionals being generated, unlike in the gcc/ directory).  Also
note that libvtv/testsuite/other-tests/Makefile.in was not
regenerated; that directory is not listed as a subdirectory for which
Makefile.in gets regenerated by calling "automake" in libvtv/, so I'm
not sure how it's meant to be regenerated.

While I mostly fixed warnings should running aclocal / automake /
autoconf, there were various such warnings from automake in the
libgfortran, libgo, libgomp, liboffloadmic, libsanitizer, libphobos
directories that I did not fix, preferring to leave those to the
relevant subsystem maintainers.  Specifically, most of those warnings
were of the following form (example from libgfortran):

Makefile.am:48: warning: source file 'caf/single.c' is in a subdirectory,
Makefile.am:48: but option 'subdir-objects' is disabled
automake: warning: possible forward-incompatibility.
automake: At least a source file is in a subdirectory, but the 'subdir-objects'
automake: automake option hasn't been enabled.  For now, the corresponding output
automake: object file(s) will be placed in the top-level directory.  However,
automake: this behaviour will change in future Automake versions: they
will
automake: unconditionally cause object files to be placed in the same subdirectory
automake: of the corresponding sources.
automake: You are advised to start using 'subdir-objects' option throughout your
automake: project, to avoid future incompatibilities.

I think it's best for the relevant maintainers to add subdir-objects
and do any other associated Makefile.am changes needed.  In some cases
the paths in the warnings involved ../; I don't know if that adds any
extra complications to the use of subdir-objects.

I've tested this with native, cross and Canadian cross builds.  The
risk of any OS-specific issues should I hope be rather lower than if a
libtool upgrade were included (we *should* do such an upgrade at some
point, but it's more complicated - it involves identifying all our
local libtool changes to see if any aren't included in the upstream
version we update to, and reverting an upstream libtool patch that's
inappropriate for use in GCC); I think it would be better to get this
update into GCC so that people can test in different configurations
and we can fix any issues found, rather than to try to get more and
more testing done before it goes in.

top level:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* multilib.am: New file.  From automake.

	Merge from binutils-gdb:
	2018-06-19  Simon Marchi  <simon.marchi@ericsson.com>

	* libtool.m4: Use AC_LANG_SOURCE.
	* configure.ac: Remove AC_PREREQ, use AC_LANG_SOURCE.
	* ar-lib: New file.
	* test-driver: New file.
	* configure: Re-generate.

config:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* math.m4, tls.m4: Use AC_LANG_SOURCE.

	Merge from binutils-gdb:
	2018-06-19  Simon Marchi  <simon.marchi@ericsson.com>

	* override.m4 (_GCC_AUTOCONF_VERSION): Bump from 2.64 to 2.69.

fixincludes:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.
	* aclocal.m4, configure: Regenerate.

gcc:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.  Use AC_LANG_SOURCE.  Use single
	line for second argument of AC_DEFINE_UNQUOTED.
	* doc/install.texi (Tools/packages necessary for modifying GCC):
	Update to autoconf 2.69 and automake 1.15.1.
	* aclocal.m4, config.in, configure: Regenerate.

gnattools:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.
	* configure: Regenerate.

gotools:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* config/go.m4: Remove file.
	* Makefile.am (ACLOCAL_AMFLAGS): Do not use -I ./config.
	* configure.ac:  Remove AC_PREREQ.  Do not include config/go.m4.
	* Makefile.in, aclocal.m4, configure: Regenerate.

intl:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	Merge from binutils-gdb:
	2018-06-19  Simon Marchi  <simon.marchi@ericsson.com>

	* configure.ac: Add AC_USE_SYSTEM_EXTENSIONS, remove AC_PREREQ.
	* configure: Re-generate.
	* config.h.in: Re-generate.
	* aclocal.m4: Re-generate.

libada:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.
	* configure: Regenerate.

libatomic:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	* acinclude.m4: Use AC_LANG_SOURCE.
	* configure.ac: Remove AC_PREREQ.
	* testsuite/Makefile.am (RUNTEST): Remove quotes.
	* Makefile.in, aclocal.m4, configure, testsuite/Makefile.in:
	Regenerate.

libbacktrace:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	* configure.ac: Remove AC_PREREQ.  Use AC_LANG_SOURCE.
	* Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.

libcc1:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.
	* Makefile.in, aclocal.m4, configure: Regenerate.

libcpp:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.  Use AC_LANG_SOURCE.
	* aclocal.m4, config.in, configure: Regenerate.

libdecnumber:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	Merge from binutils-gdb:
	2018-06-19  Simon Marchi  <simon.marchi@ericsson.com>

	* configure.ac: Remove AC_PREREQ.
	* configure: Re-generate.
	* aclocal.m4.

libffi:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	(AUTOMAKE_OPTIONS): Add info-in-builddir.
	(CLEANFILES): Remove doc/libffi.info.
	* configure.ac: Remove AC_PREREQ.
	* Makefile.in, aclocal.m4, configure, fficonfig.h.in,
	include/Makefile.in, man/Makefile.in, testsuite/Makefile.in:
	Regenerate.

libgcc:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.  Use AC_LANG_SOURCE.
	* configure: Regenerate.

libgfortran:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	* configure.ac: Remove AC_PREREQ.
	* Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.

libgo [logically part of this change but omitted from the commit]:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	* config/go.m4: Remove file.
	* config/libtool.m4: Use AC_LANG_SOURCE.
	* configure.ac: Remove AC_PREREQ.  Use AC_LANG_SOURCE.  Use
	-Wno-override in AM_INIT_AUTOMAKE call.
	* Makefile.in, aclocal.m4, configure, testsuite/Makefile.in:
	Regenerate.

libgomp:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am
	(AUTOMAKE_OPTIONS): Add info-in-builddir.
	(CLEANFILES): Remove libgomp.info.
	* configure.ac: Remove AC_PREREQ.
	* testsuite/Makefile.am (RUNTEST): Remove quotes.
	* Makefile.in, aclocal.m4, configure, testsuite/Makefile.in:
	Regenerate.

libhsail-rt:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.
	* Makefile.in, aclocal.m4, configure: Regenerate.

libiberty:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	Merge from binutils-gdb:
	2018-06-19  Simon Marchi  <simon.marchi@ericsson.com>

	* configure.ac: Remove AC_PREREQ.
	* configure: Re-generate.
	* config.in: Re-generate.

libitm:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	(AUTOMAKE_OPTIONS): Add info-in-builddir.
	(CLEANFILES): Remove libitm.info.
	* configure.ac: Remove AC_PREREQ.
	* testsuite/Makefile.am (RUNTEST): Remove quotes.
	* Makefile.in, aclocal.m4, configure, testsuite/Makefile.in:
	Regenerate.

libobjc:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.
	* aclocal.m4, config.h.in, configure: Regenerate.

liboffloadmic:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	* configure.ac: Remove AC_PREREQ.
	* plugin/Makefile.am: Include multilib.am.
	* plugin/configure.ac: Remove AC_PREREQ.
	* Makefile.in, aclocal.m4, configure, plugin/Makefile.in,
	plugin/aclocal.m4, plugin/configure: Regenerate.

libphobos:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	* configure.ac: Remove AC_PREREQ.  Use -Wno-override in
	AM_INIT_AUTOMAKE call.
	* m4/autoconf.m4: Add extra argument to AC_LANG_DEFINE call.
	* m4/druntime/os.m4: Use AC_LANG_SOURCE.
	* testsuite/Makefile.am (RUNTEST): Remove quotes.
	* Makefile.in, aclocal.m4, configure, libdruntime/Makefile.in,
	src/Makefile.in, testsuite/Makefile.in: Regenerate.

libquadmath:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	(AUTOMAKE_OPTIONS): Remove 1.8.  Add info-in-builddir.
	(all-local): Define outside conditional code.
	(CLEANFILES): Remove libquadmath.info.
	* configure.ac: Remove AC_PREREQ.
	* Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.

libsanitizer:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	* configure.ac: Remove AC_PREREQ.  Use AC_LANG_SOURCE.
	* Makefile.in, aclocal.m4, asan/Makefile.in, configure,
	interception/Makefile.in, libbacktrace/Makefile.in,
	lsan/Makefile.in, sanitizer_common/Makefile.in, tsan/Makefile.in,
	ubsan/Makefile.in: Regenerate.

libssp:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	(AUTOMAKE_OPTIONS): Remove 1.9.5.
	* configure.ac: Remove AC_PREREQ.  Quote argument to
	AC_RUN_IFELSE.
	* Makefile.in, aclocal.m4, configure: Regenerate.

libstdc++-v3:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	* configure.ac: Remove AC_PREREQ.
	* Makefile.in, aclocal.m4, configure, 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++17/Makefile.in, src/c++98/Makefile.in,
	src/filesystem/Makefile.in, testsuite/Makefile.in: Regenerate.

libvtv:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	* configure.ac: Remove AC_PREREQ.
	* testsuite/Makefile.am (RUNTEST): Remove quotes.
	* Makefile.in, aclocal.m4, configure, testsuite/Makefile.in:
	Regenerate.

lto-plugin:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.  Use AC_LANG_SOURCE.
	* Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.

zlib:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.

	Merge from binutils-gdb:
	2018-06-19  Simon Marchi  <simon.marchi@ericsson.com>

	* configure.ac: Modernize AC_INIT call, remove AC_PREREQ.
	* Makefile.am (AUTOMAKE_OPTIONS): Remove 1.8, cygnus, add foreign.
	* Makefile.in: Re-generate.
	* aclocal.m4: Re-generate.
	* configure: Re-generate.

From-SVN: r265695
2018-10-31 17:03:16 +00:00
Jonathan Wakely cfaa1c8908 * libsupc++/cxxabi.h (__cxa_demangle): Clarify doxygen comment.
From-SVN: r264127
2018-09-05 16:18:16 +01:00
Marc Glisse 6eac0600c4 new(nothrow) is malloc-like
2018-08-24  Marc Glisse  <marc.glisse@inria.fr>

	PR libstdc++/86822
	* libsupc++/new (operator new(size_t, nothrow_t), operator
	new[](size_t, nothrow_t), operator new(size_t, align_val_t, nothrow_t),
	operator new[](size_t, align_val_t, nothrow_t)): Add malloc attribute.

From-SVN: r263841
2018-08-24 18:24:42 +00:00
Jonathan Wakely 2383ed0269 Minor optimisations in operator new(size_t, align_val_t)
* libsupc++/new_opa.cc (operator new(size_t, align_val_t)): Use
	__is_pow2 to check for valid alignment. Avoid branching when rounding
	size to multiple of alignment.

From-SVN: r263515
2018-08-13 19:54:38 +01:00
Jonathan Wakely b66e5a95c0 PR libstdc++/68210 adjust operator new and delete for LWG 206
Ensure that nothrow versions of new and delete call the ordinary
versions of new or delete, instead of calling malloc or free directly.

These files are all compiled with -std=gnu++14 so can use noexcept and
nullptr to make the code more readable.

	PR libstdc++/68210
	* doc/xml/manual/intro.xml: Document LWG 206 change.
	* libsupc++/del_op.cc: Replace _GLIBCXX_USE_NOEXCEPT with noexcept.
	* libsupc++/del_opa.cc: Likewise.
	* libsupc++/del_opant.cc: Likewise.
	* libsupc++/del_opnt.cc: Likewise. Call operator delete(ptr) instead
	of free(ptr).
	* libsupc++/del_ops.cc: Replace _GLIBCXX_USE_NOEXCEPT with noexcept.
	* libsupc++/del_opsa.cc: Likewise.
	* libsupc++/del_opva.cc: Likewise.
	* libsupc++/del_opvant.cc: Likewise.
	* libsupc++/del_opvnt.cc: Likewise. Call operator delete[](ptr)
	instead of operator delete(ptr).
	* libsupc++/del_opvs.cc: Replace _GLIBCXX_USE_NOEXCEPT with noexcept.
	* libsupc++/del_opvsa.cc: Likewise.
	* libsupc++/new_op.cc: Use __builtin_expect in check for zero size.
	* libsupc++/new_opa.cc: Use nullptr instead of literal 0.
	* libsupc++/new_opant.cc: Likewise. Replace _GLIBCXX_USE_NOEXCEPT
	with noexcept.
	* libsupc++/new_opnt.cc: Likewise. Call operator new(sz) instead of
	malloc(sz).
	* libsupc++/new_opvant.cc: Use nullptr and noexcept.
	* libsupc++/new_opvnt.cc: Likewise. Call operator new[](sz) instead of
	operator new(sz, nothrow).
	* testsuite/18_support/new_nothrow.cc: New test.

From-SVN: r263478
2018-08-10 21:20:27 +01:00
Martin Liska 8b9a5b5e0e Remove not needed __builtin_expect due to malloc predictor.
2018-08-10  Martin Liska  <mliska@suse.cz>

	* libsupc++/new_op.cc (new): Remove __builtin_expect as malloc
        predictor can handle that.
	* libsupc++/new_opa.cc: Likewise.
	* libsupc++/new_opnt.cc (new): Likewise.

From-SVN: r263470
2018-08-10 11:40:40 +00:00
Jonathan Wakely a801991954 Prevent internal aligned_alloc clashing with libc version
If configure fails to detect aligned_alloc we will try to define our
own in new_opa.cc but that could clash with the libcversion in
<stdlib.h>. Use a namespace to keep them distinct.

	* libsupc++/new_opa.cc (aligned_alloc): Declare inside namespace to
	avoid clashing with an ::aligned_alloc function that was not detected
	by configure.

From-SVN: r263409
2018-08-08 16:16:43 +01:00
Jonathan Wakely 1d1b732865 PR libstdc++/86861 Meet precondition for Solaris memalign
Solaris memalign requires alignment to be at least sizeof(int), so
increase it as needed.

Also move the check for valid alignments from the fallback
implementation of aligned_alloc into operator new, as it's required for
all of aligned_alloc, memalign, posix_memalign and __aligned_malloc.
This adds a branch to check for undefined behaviour which we could just
ignore, so the check could just be removed. It should certainly be
removed if PR 86878 is implemented to issue a warning about calls with
invalid alignments.

	PR libstdc++/86861
	* libsupc++/new_opa.cc [_GLIBCXX_HAVE_MEMALIGN] (aligned_alloc):
	Replace macro with inline function.
	[__sun]: Increase alignment to meet memalign precondition.
	[!HAVE__ALIGNED_MALLOC && !HAVE_POSIX_MEMALIGN && !HAVE_MEMALIGN]
	(aligned_alloc): Move check for valid alignment to operator new.
	Remove redundant check for non-zero size, it's enforced by the caller.
	(operator new): Move check for valid alignment here. Use
	__builtin_expect on check for zero size.

From-SVN: r263360
2018-08-07 17:10:29 +01:00
Jonathan Wakely ff27340046 Don't unconditionally define feature test macros in <version>
The macro definitions in <version> should depend on the same
preprocessor conditions as the original macros in other headers.
Otherwise <version> can define macros that imply the availability of
features that are not actually defined.

This fix is incomplete, as __cpp_lib_filesystem should depend on whether
libstdc++fs.a is supported, and several macros should only be defined
when _GLIBCXX_HOSTED is defined. Also, the feature test macros should
define their value as type long, but most are type int.

	* include/bits/c++config (_GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP)
	(_GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE): Move definitions here.
	(_GLIBCXX_HAVE_BUILTIN_LAUNDER): Likewise. Use !__is_identifier
	instead of __has_builtin.
	* include/std/type_traits (_GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP)
	(_GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE): Remove definitions from here.
	* include/std/version [!_GLIBCXX_HAS_GTHREADS]
	(__cpp_lib_shared_timed_mutex, __cpp_lib_scoped_lock)
	(__cpp_lib_shared_mutex): Don't define when Gthreads not in use.
	[!_GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP]
	(__cpp_lib_has_unique_object_representations): Don't define when
	builtin not available.
	[!_GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE] (__cpp_lib_is_aggregate):
	Likewise.
	[!_GLIBCXX_HAVE_BUILTIN_LAUNDER] (__cpp_lib_launder): Likewise.
	* libsupc++/new (_GLIBCXX_HAVE_BUILTIN_LAUNDER): Remove definition
	from here.

From-SVN: r263184
2018-07-31 23:31:14 +01:00
Jonathan Wakely 1b3b888d11 Add workaround for aligned_alloc bug on AIX
20_util/memory_resource/2.cc FAILs on AIX 7.2.0.0, because aligned_alloc
incorrectly requires the alignment to be a multiple of sizeof(void*).

This adds a workaround to the operator new overload taking an alignment
value, to increase the alignment (and size) if needed.

	* libsupc++/new_opa.cc (operator new(size_t, align_val_t)): Add
	workaround for aligned_alloc bug on AIX.
	* testsuite/18_support/new_aligned.cc: New test.

From-SVN: r263073
2018-07-30 18:12:44 +01:00
Jonathan Wakely c3be340eb6 PR libstdc++/86450 use -Wabi=2 and simplify -Werror use
Use -Wabi=2 to fix warnings about -Wabi having no effect on its own.
This requires suppressing two warnings in src/c++11/debug.cc which do
not affect the library ABI.

Previously libstdc++ defaulted to --enable-werror but the -Werror flag
was not actually added unless --enable-maintainer-mode was used. This is
not documented and not the expected behaviour. This removes any special
treatment for maintainer-mode, makes -Werror depend directly on
--enable-werror, and changes the default to --enable-werror=no.

	PR libstdc++/86450
	* acinclude.m4 (GLIBCXX_CHECK_COMPILER_FEATURES): Don't define WERROR.
	(GLIBCXX_EXPORT_FLAGS): Use -Wabi=2 instead of -Wabi.
	* configure: Regenerate.
	* configure.ac: Change GLIBCXX_ENABLE_WERROR default to "no".
	* doc/Makefile.in: Regenerate.
	* fragment.am: Set WERROR_FLAG to -Werror instead of $(WERROR).
	* include/Makefile.in: Regenerate.
	* libsupc++/Makefile.in: Regenerate.
	* po/Makefile.in: Regenerate.
	* python/Makefile.in: Regenerate.
	* src/Makefile.in: Regenerate.
	* src/c++11/Makefile.in: Regenerate.
	* src/c++11/debug.cc: Use diagnostic pragmas to suppress warnings
	from -Wabi=2 that don't affect exported symbols.
	* src/c++98/Makefile.in: Regenerate.
	* src/filesystem/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.

From-SVN: r262824
2018-07-17 14:18:47 +01:00
Jonathan Wakely d04dbb8ad3 PR libstdc++/85831 define move constructors and operators for exceptions
PR libstdc++/85831
	* config/abi/pre/gnu.ver: Export move constructors and move
	assignment operators for std::logic_error and std::runtime_error.
	* include/std/stdexcept: Use _GLIBCXX_NOTHROW instead of
	_GLIBCXX_USE_NOEXCEPT.
	(logic_error, runtime_error): Declare move constructors and move
	assignment operators. When not declared already, define copy
	constructors and copy assignment operators as explicit-defaulted.
	(domain_error, invalid_argument, length_error, out_of_range)
	(overflow_error, underflow_error): Define move constructors and move
	assignment operators as explicitly-defaulted.
	* libsupc++/exception.h (exception): Likewise.
	* src/c++11/cow-stdexcept.cc (logic_error, runtime_error): Define
	move constructors and move assignment operators as defaulted.
	* testsuite/19_diagnostics/stdexcept.cc: Check that constructors and
	assignment operators are defined.

From-SVN: r262456
2018-07-05 22:29:51 +01:00
Jason Merrill f07c223768 Some libstdc++ fixes for -Wdeprecated-copy.
* include/bits/stl_deque.h (_Deque_iterator): Constrain constructor
	for conversion to const_iterator.  Add defaulted copy ops.
	* libsupc++/new (bad_alloc): Add defaulted copy ops.
	* libsupc++/exception.h (exception): Add defaulted copy ops.
	* include/std/system_error (system_error): Add defaulted copy ops.
	* include/std/stdexcept (domain_error, invalid_argument)
	(length_error, out_of_range, range_error, overflow_error)
	(underflow_error): Add defaulted copy ops.
	* include/bits/stl_iterator.h (reverse_iterator): Add defaulted
	copy assignment.
	* include/bits/allocator.h (allocator): Add defaulted copy assignment.
	* include/ext/throw_allocator.h (condition_base): Add defaulted
	default and copy ctor and copy assignment.

From-SVN: r260380
2018-05-18 16:02:14 -04:00
Jonathan Wakely ff03245e00 PR libstdc++/85812 fix memory leak in std::make_exception_ptr
PR libstdc++/85812
	* libsupc++/cxxabi_init_exception.h (__cxa_free_exception): Declare.
	* libsupc++/exception_ptr.h (make_exception_ptr) [__cpp_exceptions]:
	Refactor to separate non-throwing and throwing implementations.
	[__cpp_rtti && !_GLIBCXX_HAVE_CDTOR_CALLABI]: Deallocate the memory
	if constructing the object throws.

From-SVN: r260323
2018-05-17 16:03:29 +01:00
Jakub Jelinek 85ec4feb11 Update copyright years.
From-SVN: r256169
2018-01-03 11:03:58 +01:00
Jason Merrill 0382bcfcda Correct noexcept mismatch in declarations.
2017-12-05  Jason Merrill  <jason@redhat.com>
	    Jonathan Wakely  <jwakely@redhat.com>

	* include/bits/fs_fwd.h (copy, copy_file): Remove noexcept.
	(permissions): Add noexcept.
	* include/bits/fs_ops.h (permissions): Add noexcept.
	* libsupc++/eh_throw.cc (__cxa_init_primary_exception): Add
	_GLIBCXX_NOTHROW.

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

From-SVN: r255425
2017-12-05 15:23:26 +00:00
Jonathan Wakely c85d199208 Add [[noreturn]] attributes to fix warning
* libsupc++/nested_exception.h (__throw_with_nested_impl): Add
	noreturn attribute.

From-SVN: r255315
2017-12-01 15:10:13 +00:00
Jonathan Wakely a8541d9021 Add [[nodiscard]] attribute to std::launder
* libsupc++/new (launder): Add nodiscard attribute.
	* testsuite/18_support/launder/nodiscard.cc: New test.

From-SVN: r255127
2017-11-24 00:00:46 +00:00
Igor Tsimbalist 36101de964 Enable building libstdc++-v3 with Intel CET
libstdc++-v3/
	* acinclude.m4: Add cet.m4.
	* configure.ac: Set CET_FLAGS. Update EXTRA_CFLAGS,
	EXTRA_CXX_FLAGS.
	* libsupc++/Makefile.am: Use Add EXTRA_CFLAGS.
	* Makefile.in: Regenerate.
	* configure: Likewise.
	* doc/Makefile.in: Likewise.
	* include/Makefile.in: Likewise.
	* libsupc++/Makefile.in: Likewise.
	* po/Makefile.in: Likewise.
	* python/Makefile.in: Likewise.
	* src/Makefile.in: Likewise.
	* src/c++11/Makefile.in: Likewise.
	* src/c++98/Makefile.in: Likewise.
	* src/filesystem/Makefile.in: Likewise.
	* testsuite/Makefile.in: Likewise.

From-SVN: r254895
2017-11-17 22:28:10 +01:00
Jonathan Wakely 95ed529d34 PR libstdc++/81469 deprecate std::uncaught_exception for C++17
PR libstdc++/81469
	* libsupc++/exception (uncaught_exception): Deprecate for C++17.
	* testsuite/18_support/exception_ptr/62258.cc: Add -Wno-deprecated.
	* testsuite/18_support/uncaught_exception/14026.cc: Likewise.

From-SVN: r253018
2017-09-20 17:34:49 +01:00
Jonathan Wakely 20f661fbd2 Remove non-standard std::copy_exception function
* libsupc++/exception_ptr.h (copy_exception): Remove deprecated
	non-standard function.

From-SVN: r253011
2017-09-20 14:25:07 +01:00
Jonathan Wakely ff7e6f066b PR libstdc++/81835 fix broken URLs in libstdc++ docs
PR libstdc++/81835
	* doc/xml/manual/extensions.xml: Replace unstable URL.
	* doc/html/manual/ext_demangling.html: Regenerate.
	* libsupc++/cxxabi.h (__cxa_demangle): Fix broken URL.

From-SVN: r252066
2017-09-13 11:05:59 +01:00
Volker Reichelt 57c51668ee new (bad_array_new_length): Remove redundant semicolon after in-class member function definition.
* libsupc++/new (bad_array_new_length): Remove redundant
        semicolon after in-class member function definition.
        * include/bits/locale_facets.h (ctype_byname, num_put): Likewise.
        * include/bits/locale_facets_nonio.h (time_put_byname): Likewise.
        * include/bits/random.h (mersenne_twister_engine): Likewise.
        * include/tr1/random.h (mersenne_twister): Likewise
        * include/ext/random (simd_fast_mersenne_twister_engine): Likewise.
        * include/ext/rope (char_producer, _Rope_char_consumer,
        _Rope_self_destruct_ptr, _Rope_const_iterator, _Rope_iterator):
        Likewise.
        * include/ext/ropeimpl.h (_Rope_flatten_char_consumer,
        _Rope_insert_char_consumer): Likewise.

From-SVN: r250357
2017-07-19 16:59:00 +00:00
Jonathan Wakely ef3985dbd1 Remove libsupc++ makefile targets setting -std=gnu++11 or -std=gnu++14
* libsupc++/Makefile.am: Remove custom targets for files that need to
	be compiled as C++11 or C++14.
	* libsupc++/Makefile.in: Regenerate.
	* libsupc++/del_ops.cc: Use pragma to disable -Wsized-deallocation
	warnings.
	* libsupc++/del_opvs.cc: Likewise.

From-SVN: r248823
2017-06-02 12:49:04 +01:00
Richard Biener 1c26adb74d re PR libstdc++/80721 (Sorting/Merging of free EH-emergency buffer may wrong or uncomplete)
2017-06-02  Richard Biener  <rguenther@suse.de>
	Markus Eisenmann  <meisenmann.lba@fh-salzburg.ac.at>

	PR libstdc++/80721
	* libsupc++/eh_alloc.cc (pool::free): Keep list properly
	sorted and add missing freelist item merging cases.

Co-Authored-By: Markus Eisenmann <meisenmann.lba@fh-salzburg.ac.at>

From-SVN: r248816
2017-06-02 08:10:48 +00:00
Jonathan Wakely 6a8446fa8b * libsupc++/new: Update comment on #endif directive.
From-SVN: r246999
2017-04-19 16:18:24 +01:00
Jonathan Wakely afa56c1751 PR libstdc++/80446 cope with libc defining __has_builtin
PR libstdc++/80446
	* include/std/type_traits (is_aggregate): Change __has_builtin checks.
	* libsupc++/new (launder): Likewise.

From-SVN: r246992
2017-04-19 11:49:12 +01:00
Jonathan Wakely d34d36ef0d PR libstdc++/79789 fix non-reserved names in headers
PR libstdc++/79789
	* include/bits/hashtable_policy.h (__clp2): Use reserved names for
	parameters and local variables.
	* include/bits/ios_base.h (make_error_code, make_error_condition):
	Likewise.
	* include/bits/list.tcc (list::sort): Likewise.
	* include/bits/mask_array.h (mask_array): Likewise.
	* include/bits/regex.h (regex_token_iterator): Likewise.
	* include/bits/slice_array.h (slice_array): Likewise.
	* include/bits/stl_algo.h (__sample): Likewise.
	* include/std/memory (undeclare_no_pointers): Likewise.
	* include/std/type_traits (is_callable_v, is_nothrow_callable_v):
	Likewise.
	* libsupc++/exception_ptr.h (__dest_thunk): Likewise.
	* testsuite/17_intro/headers/names.cc: New test.

From-SVN: r245828
2017-03-02 03:43:49 +00:00
Jonathan Wakely bc9efeab61 PR libstdc++/79190 add fallback aligned_alloc implementation
libstdc++-v3:

	PR libstdc++/79190
	* libsupc++/del_opa.cc (operator delete(void*, std::align_val_t))
	[!_GLIBCXX_HAVE_ALIGNED_ALLOC && !_GLIBCXX_HAVE_POSIX_MEMALIGN
	&& !_GLIBCXX_HAVE_MEMALIGN && !_GLIBCXX_HAVE__ALIGNED_MALLOC]:
	Retrieve original pointer value allocated by malloc.
	* libsupc++/new_opa.cc [!_GLIBCXX_HAVE_ALIGNED_ALLOC
	&& !_GLIBCXX_HAVE_POSIX_MEMALIGN && !_GLIBCXX_HAVE_MEMALIGN
	&& !_GLIBCXX_HAVE__ALIGNED_MALLOC] (aligned_alloc(size_t, size_t)):
	Define, adjusting pointer value allocated by malloc and storing for
	retrieval by operator delete.

gcc/testsuite:

	PR libstdc++/79190
	* g++.dg/cpp1z/aligned-new3.C: Replace operator new so behaviour
	matches replaced operator delete.

From-SVN: r244933
2017-01-26 14:30:45 +00:00
Jakub Jelinek 68edb9bafe update-copyright.py: Add libhsail-rt to self.default_dirs and call self.add_dir on it.
contrib/
	* update-copyright.py: Add libhsail-rt to self.default_dirs
	and call self.add_dir on it.  Add Intel Corporation to external
	authors.
gcc/
	* brig-builtins.def: Update copyright years.
	* config/arm/arm_acle_builtins.def: Update copyright years.
gcc/brig/
	Update copyright years.
gcc/testsuite/
	* brig.dg/dg.exp: Update copyright years.
	* lib/brig-dg.exp: Update copyright years.
	* lib/brig.exp: Update copyright years.
libhsail-rt/
	Update copyright years.
libstdc++-v3/
	* libsupc++/eh_atomics.h: Update copyright years.
	* testsuite/20_util/unique_ptr/cons/default.cc: Update copyright years.

From-SVN: r244919
2017-01-26 09:24:22 +01:00
Jonathan Wakely 04c872aae4 PR79114 use decayed type in std::throw_with_nested assertion
PR libstdc++/79114
	* libsupc++/nested_exception.h (throw_with_nested): Use decay instead
	of remove_reference.
	* testsuite/18_support/nested_exception/79114.cc: New test.

From-SVN: r244531
2017-01-17 15:26:06 +00:00
Jakub Jelinek 3c36aa6ba2 re PR other/79046 (g++ -print-file-name=plugin uses full version number in path)
PR other/79046
	* configure: Regenerated.
config/
	* acx.m4 (GCC_BASE_VER): New m4 function.
	(ACX_TOOL_DIRS): Require GCC_BASE_VER, for
	--with-gcc-major-version-only use just major number from BASE-VER.
gcc/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.in (version): Use @get_gcc_base_ver@ instead of cat to get
	version from BASE-VER file.
	(CFLAGS-gcc.o): Add -DBASEVER=$(BASEVER_s).
	(gcc.o): Depend on $(BASEVER).
	* common.opt (dumpfullversion): New option.
	* gcc.c (driver_handle_option): Handle OPT_dumpfullversion.
	* doc/invoke.texi: Document -dumpfullversion.
	* doc/install.texi: Document --with-gcc-major-version-only.
	* configure: Regenerated.
libatomic/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* testsuite/Makefile.in: Regenerated.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
libgomp/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* testsuite/Makefile.in: Regenerated.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
libgcc/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.in (version): Use @get_gcc_base_ver@ instead of cat to get
	version from BASE-VER file.
	* configure: Regenerated.
libssp/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
liboffloadmic/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* aclocal.m4: Include ../config/acx.m4.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
libquadmath/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
libmpx/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
libada/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.in (version): Use @get_gcc_base_ver@ instead of cat to get
	version from BASE-VER file.
	* configure: Regenerated.
lto-plugin/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
libitm/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* testsuite/Makefile.in: Regenerated.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
fixincludes/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.in (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* configure: Regenerated.
libcilkrts/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* aclocal.m4: Include ../config/acx.m4.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
libcc1/
	* configure.ac: Add GCC_BASE_VER.  For --with-gcc-major-version-only
	use just major number from BASE-VER.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
libobjc/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.in (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* configure: Regenerated.
libstdc++-v3/
	* configure.ac: Add GCC_BASE_VER.
	* fragment.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* po/Makefile.in: Regenerated.
	* libsupc++/Makefile.in: Regenerated.
	* testsuite/Makefile.in: Regenerated.
	* src/Makefile.in: Regenerated.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
	* include/Makefile.in: Regenerated.
	* doc/Makefile.in: Regenerated.
	* python/Makefile.in: Regenerated.
	* src/c++11/Makefile.in: Regenerated.
	* src/c++98/Makefile.in: Regenerated.
	* src/filesystem/Makefile.in: Regenerated.
libvtv/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* testsuite/Makefile.in: Regenerated.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
libsanitizer/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* libbacktrace/Makefile.in: Regenerated.
	* interception/Makefile.in: Regenerated.
	* asan/Makefile.in: Regenerated.
	* ubsan/Makefile.in: Regenerated.
	* configure: Regenerated.
	* sanitizer_common/Makefile.in: Regenerated.
	* lsan/Makefile.in: Regenerated.
	* Makefile.in: Regenerated.
	* tsan/Makefile.in: Regenerated.
libgfortran/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* configure: Regenerated.
	* Makefile.in: Regenerated.

From-SVN: r244521
2017-01-17 10:38:48 +01: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 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
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
Jakub Jelinek cbe34bb5ed Update copyright years.
From-SVN: r243994
2017-01-01 13:07:43 +01:00