Commit Graph

538 Commits

Author SHA1 Message Date
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
Jonathan Wakely 27b3b3f4e6 PR 59406 note that FNV hash functions are incorrect
PR libstdc++/59406
	* include/bits/functional_hash.h: Add comment noting difference from
	FNV-1a.
	* include/tr1/functional_hash.h: Likewise.
	* libsupc++/hash_bytes.cc: Likewise.

From-SVN: r242454
2016-11-15 20:17:39 +00:00
Jason Merrill 51dc660315 Implement P0012R1, Make exception specifications part of the type system.
gcc/cp/
	* cp-tree.h (enum tsubst_flags): Add tf_fndecl_type.
	(flag_noexcept_type, ce_type): New.
	* call.c (build_conv): Add ck_fnptr.
	(enum conversion_kind): Change ck_tsafe to ck_fnptr.
	(convert_like_real): Likewise.
	(standard_conversion): Likewise.  Allow function pointer
	conversions for pointers to member functions.
	(reference_compatible_p): Allow function pointer conversions.
	(direct_reference_binding): Likewise.
	(reference_binding): Reference-compatible is no longer a subset of
	reference-related.
	(is_subseq): Also strip ck_lvalue after next_conversion.
	* class.c (instantiate_type): Check fnptr_conv_p.
	(resolve_address_of_overloaded_function): Likewise.
	* cvt.c (can_convert_tx_safety): Now static.
	(noexcept_conv_p, fnptr_conv_p, strip_fnptr_conv): New.
	* decl.c (flag_noexcept_type): Define.
	(cxx_init_decl_processing): Set it.
	(bad_specifiers): Check it.
	(grokdeclarator) [cdk_function]: Add exception-spec to type here.
	* lambda.c (maybe_add_lambda_conv_op): Add exception-spec to
	returned pointer.
	* mangle.c (struct globals): Add need_cxx1z_warning.
	(mangle_decl): Check it.
	(write_exception_spec): New.
	(write_function_type): Call it.
	(canonicalize_for_substitution): Handle exception spec.
	(write_type): Likewise.
	(write_encoding): Set processing_template_decl across mangling of
	partially-instantiated type.
	* pt.c (determine_specialization): Pass tf_fndecl_type.
	(tsubst_decl, fn_type_unification): Likewise.
	(tsubst): Strip tf_fndecl_type, pass it to
	tsubst_exception_specification.
	(convert_nontype_argument_function): Handle function pointer
	conversion.
	(convert_nontype_argument): Likewise.
	(unify, for_each_template_parm_r): Walk into noexcept-specifier.
	* rtti.c (ptr_initializer): Encode noexcept.
	* tree.c (canonical_eh_spec): New.
	(build_exception_variant): Use it.
	* typeck.c (composite_pointer_type): Handle fnptr conversion.
	(comp_except_specs): Compare canonical EH specs.
	(structural_comptypes): Call it.
gcc/c-family/
	* c.opt (Wc++1z-compat): New.
	* c-cppbuiltin.c (c_cpp_builtins): Add __cpp_noexcept_function_type.
libstdc++-v3/
	* include/bits/c++config (_GLIBCXX_NOEXCEPT_PARM)
	(_GLIBCXX_NOEXCEPT_QUAL): New.
	* include/std/type_traits (is_function): Use them.
	* libsubc++/new (launder): Likewise.
	* libsupc++/cxxabi.h (__pbase_type_info::__masks): Add
	__noexcept_mask.
	* libsupc++/pbase_type_info.cc (__do_catch): Handle function
	pointer conversion.
libiberty/
	* cp-demangle.c (is_fnqual_component_type): New.
	(d_encoding, d_print_comp_inner, d_print_mod_list): Use it.
	(FNQUAL_COMPONENT_CASE): New.
	(d_make_comp, has_return_type, d_print_comp_inner)
	(d_print_function_type): Use it.
	(next_is_type_qual): New.
	(d_cv_qualifiers, d_print_mod): Handle noexcept and throw-spec.
include/
	* demangle.h (enum demangle_component_type): Add
	DEMANGLE_COMPONENT_NOEXCEPT, DEMANGLE_COMPONENT_THROW_SPEC.

From-SVN: r241944
2016-11-07 18:09:29 -05:00
Jonathan Wakely 1f5700e952 Implement std::launder for C++17
* doc/xml/manual/status_cxx2017.xml: Update status.
	* doc/html/*: Regenerate.
	* include/std/type_traits (has_unique_object_representations): Guard
	with __has_builtin check.
	* libsupc++/new (launder): Define for C++17.
	* testsuite/18_support/launder/1.cc: New test.
	* testsuite/18_support/launder/requirements.cc: New test.
	* testsuite/18_support/launder/requirements_neg.cc: New test.

From-SVN: r241648
2016-10-28 15:09:33 +01:00
Bernd Edlinger a0019047b8 re PR libstdc++/78110 (freestanding libstdc++ fails to compile)
2016-10-26  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        PR libstdc++/78110
        * libsupc++/new_opa.cc: Don't include <malloc.h> in a free standing
        environment.  Declare memalign directly in that case.

From-SVN: r241591
2016-10-26 17:26:00 +00:00
Jonathan Wakely 6652a944dc Use global operator new in std::make_exception_ptr
* libsupc++/exception_ptr.h (make_exception_ptr): Qualify new.
	* testsuite/18_support/exception_ptr/make_exception_ptr_2.cc: New
	test.

From-SVN: r241404
2016-10-21 14:21:09 +01:00
Jonathan Wakely 40571365a0 Remove 'return' from noreturn function
* libsupc++/nested_exception.h (throw_with_nested): Remove return.

From-SVN: r241032
2016-10-12 12:20:29 +01:00
Jonathan Wakely 0470fad0d6 Simplify std::rethrow_if_nested definition
* doc/xml/manual/intro.xml: Document LWG 2484 status.
	* libsupc++/nested_exception.h (_Throw_with_nested_impl)
	(_Throw_with_nested_helper): Remove.
	(__throw_with_nested_impl): New overloaded functions to implement
	throw_with_nested logic.
	(throw_with_nested): Call __throw_with_nested_impl.
	(_Rethrow_if_nested_impl): Remove
	(__rethrow_if_nested_impl): New overloaded functions to implement
	rethrow_if_nested logic.
	(rethrow_if_nested): Call __rethrow_if_nested_impl.
	* testsuite/18_support/nested_exception/rethrow_if_nested.cc: Test
	problem cases from LWG 2484.

From-SVN: r240983
2016-10-11 11:33:36 +01:00
Jonathan Wakely a3dbb63597 Use noexcept instead of _GLIBCXX_USE_NOEXCEPT
* libsupc++/eh_ptr.cc (exception_ptr): Replace _GLIBCXX_USE_NOEXCEPT
	with noexcept.

From-SVN: r240943
2016-10-10 19:32:40 +01:00
Alan Modra 6d49b790fd Disable .gnu.attributes tags in compatibility-ldbl.o
compatibility-ldbl.o is compiled with -mlong-double-64.  When
long double .gnu.attributes tags are checked by the linker, it
complains about the mismatch between this file and others in
libstdc++.

	* configure.ac (LONG_DOUBLE_COMPAT_FLAGS): New ACSUBST.
	* src/Makefile.am (compatibility-ldbl.o, compatibility-ldbl.lo):
	Use LONG_DOUBLE_COMPAT_FLAGS.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* doc/Makefile.in: Regenerate.
	* 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++98/Makefile.in: Regenerate.
	* src/filesystem/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.

From-SVN: r240602
2016-09-29 07:33:17 +09:30
Marek Polacek 81fea426da Implement -Wimplicit-fallthrough.
Co-Authored-By: Jakub Jelinek <jakub@redhat.com>

From-SVN: r240485
2016-09-26 09:42:50 +00:00
Jonathan Wakely 84c08ec96a Replace modulus with mask operation in over-aligned new
2016-09-16  Jonathan Wakely  <jwakely@redhat.com>
	    Marc Glisse  <marc.glisse@inria.fr>

	* libsupc++/new_opa.cc [_GLIBCXX_HAVE_ALIGNED_ALLOC]
	(operator new(size_t, align_val_t)): Replace modulus operator with
	mask.

Co-Authored-By: Marc Glisse <marc.glisse@inria.fr>

From-SVN: r240192
2016-09-16 19:09:14 +01:00
Jonathan Wakely 426042f5f2 Adjust arguments to aligned_alloc or posix_memalign
* libsupc++/new_opa.cc [_GLIBCXX_HAVE_POSIX_MEMALIGN] (aligned_alloc):
	Increase alignment if less than sizeof(void*).
	[_GLIBCXX_HAVE_ALIGNED_ALLOC] (operator new(size_t, align_val_t)):
	Increase size if not a multiple of alignment.

From-SVN: r240187
2016-09-16 13:11:19 +01:00
Jonathan Wakely 2501129262 Fix bootstrap failure when ATOMIC_INT_LOCK_FREE < 2
* libsupc++/new_opant.cc: Include exception_defines.h.
	* libsupc++/new_opvant.cc: Likewise.

From-SVN: r240080
2016-09-11 11:19:30 +01:00
Jason Merrill af63ba4b30 Implement P0035R4, C++17 new of over-aligned types.
gcc/cp/
	* cp-tree.h (enum cp_tree_index): Add CPTI_ALIGN_TYPE.
	(align_type_node): New macro.
	* call.c (build_operator_new_call): Handle C++17 aligned new.
	(second_parm_is_size_t, build_op_delete_call): Likewise.
	(non_placement_deallocation_fn_p): Likewise. Rename to
	usual_deallocation_fn_p.
	(aligned_allocation_fn_p, aligned_deallocation_fn_p): New.
	* decl.c (cxx_init_decl_processing): Add aligned new support.
	* init.c (type_has_new_extended_alignment): New.
	(build_new_1): Handle aligned new.
	* tree.c (vec_copy_and_insert): New.
gcc/c-family/
	* c.opt: Add -faligned-new and -Waligned-new.
	* c-common.c (max_align_t_align): Split out from...
	(cxx_fundamental_alignment_p): ...here.
	* c-common.h: Declare it.
	* c-cppbuiltin.c (c_cpp_builtins): Handle aligned new.
libstdc++-v3/
	* libsupc++/new: Declare aligned new/delete operators.
	* config/abi/pre/gnu.ver: Export them.
	* configure.ac: Check for aligned_alloc, posix_memalign, memalign,
	_aligned_malloc.
	* libsupc++/new_opa.cc: New.
	* libsupc++/new_opant.cc: New.
	* libsupc++/new_opva.cc: New.
	* libsupc++/new_opva.cc: New.
	* libsupc++/del_opa.cc: New.
	* libsupc++/del_opant.cc: New.
	* libsupc++/del_opsa.cc: New.
	* libsupc++/del_opva.cc: New.
	* libsupc++/del_opvant.cc: New.
	* libsupc++/del_opvsa.cc: New.
	* libsupc++/Makefile.am: Build them.

From-SVN: r240056
2016-09-09 17:22:15 -04:00
Gleb Natapov 27abac2648 libstdc++/68297 avoid throw/catch in make_exception_ptr
2016-08-22  Gleb Natapov  <gleb@scylladb.com>

	PR libstdc++/68297
	* config/abi/pre/gnu-versioned-namespace.ver: Export
	__cxa_init_primary_exception and std::exception_ptr(void*).
	* config/abi/pre/gnu.ver (CXXABI_1.3.11) : Add new symbol version and
	export __cxa_init_primary_exception and std::exception_ptr(void*).
	* include/Makefile.am: Add new headers.
	* include/Makefile.in: Regenerate.
	* libsupc++/Makefile.am: Add new headers.
	* libsupc++/Makefile.in: Regenerate.
	* libsupc++/cxxabi.h (__cxa_allocate_exception): Move to ...
	* libsupc++/cxxabi_init_exception.h: New header.
	(__cxa_init_primary_exception): Declare.
	* libsupc++/eh_throw.cc (__cxa_init_primary_exception): Define.
	(__cxa_throw): Use __cxa_init_primary_exception.
	* libsupc++/exception (std::exception): Move to ...
	* libsupc++/exception.h: New header.
	* libsupc++/exception_ptr.h (__exception_ptr::exception_ptr): Add
	friend declaration.
	(__exception_ptr::__dest_thunk): New function template.
	(std::make_exception_ptr) [__cpp_rtti && !_GLIBCXX_HAVE_CDTOR_CALLABI]:
	Use __cxa_allocate_exception and __cxa_init_primary_exception to
	create exception_ptr.
	* libsupc++/typeinfo: Include bits/exception.h instead of exception.
	* testsuite/util/testsuite_abi.cc: Add CXXABI_1.3.11 version.

From-SVN: r239664
2016-08-22 18:29:31 +01:00
Jonathan Wakely 18407bfb2c Use static pointer to member when catching nullptr
libstdc++-v3:

	* libsupc++/pbase_type_info.cc (__pbase_type_info::__do_catch): Use
	static objects for catching nullptr as pointer to member types.

gcc/testsuite:

	* g++.dg/cpp0x/nullptr35.C: Change expected result for catching as
	pointer to member function and also test catching by reference.

From-SVN: r238532
2016-07-20 19:21:48 +01:00
Jonathan Wakely 479d0ed590 c++/58796 Make nullptr match exception handlers of pointer type
libstdc++-v3:

	PR c++/58796
	* libsupc++/pbase_type_info.cc (__pbase_type_info::__do_catch): Make
	nullptr match handlers of pointer type.

gcc/testsuite:

	PR c++/58796
	* g++.dg/cpp0x/nullptr21.C: Remove void* handlers.
	* g++.dg/cpp0x/nullptr35.C: New test.

From-SVN: r238396
2016-07-15 19:51:51 +01:00
Jonathan Wakely 7cbadfdced Remove unused operator delete overloads (LWG 2458)
* libsupc++/new: Remove nothrow sized deletes (LWG 2458).
	* doc/xml/manual/intro.xml: Document DR 2458 status.
	* doc/html*: Regenerate.

From-SVN: r238246
2016-07-12 15:31:04 +01:00
Jonathan Wakely 00e6c25ac8 libstdc++/69945 Add __gnu_cxx::__freeres hook
PR libstdc++/69945
	* config/abi/pre/gnu.ver: Add new symbol.
	* libsupc++/eh_alloc.cc (__gnu_cxx::__freeres): Define.
	* testsuite/18_support/free_eh_pool.cc: New test.

From-SVN: r234465
2016-03-24 18:13:40 +00:00
Uros Bizjak f2f48c6c60 * libsupc++/guard.cc: Revert my last commit.
From-SVN: r234336
2016-03-18 16:44:44 +01:00
Uros Bizjak 09d8f35943 Revert:
2015-07-02  Uros Bizjak  <ubizjak@gmail.com>

	* libsupc++/guard.cc (__test_and_acquire): Use __p after __atomic_load
	to avoid unused variable warning.
	(__set_and_release): Use __p after __atomic_store to avoid unused
	variable warning.

From-SVN: r234331
2016-03-18 16:28:54 +01:00
Torvald Riegel a04d5fc95d libstdc++: Make certain exceptions transaction_safe.
From-SVN: r232454
2016-01-15 22:42:41 +00:00
Jakub Jelinek 818ab71a41 Update copyright years.
From-SVN: r232055
2016-01-04 15:30:50 +01:00
Ville Voutilainen e3fc446b9c re PR libstdc++/68139 (rethrow_if_nested should tolerate overloaded unary operator&)
PR libstdc++/68139

From-SVN: r231562
2015-12-11 14:04:23 +02:00
Jonathan Wakely c5bd8d521a * libsupc++/new_handler.cc: Fix for explicit constructor change.
From-SVN: r230184
2015-11-11 17:29:39 +00:00
Ville Voutilainen 269fa2a91b LWG 2510, make the default constructors of library tag types explicit.
2015-11-10  Ville Voutilainen  <ville.voutilainen@gmail.com>

	LWG 2510, make the default constructors of library tag types
	explicit.
	* include/bits/mutex.h (defer_lock_t, try_lock_t,
	adopt_lock_t): Add an explicit default constructor.
	* include/bits/stl_pair.h (piecewise_construct_t): Likewise.
	* include/bits/uses_allocator.h (allocator_arg_t): Likewise.
	* libsupc++/new (nothrow_t): Likewise.
	* testsuite/17_intro/tag_type_explicit_ctor.cc: New.

From-SVN: r230175
2015-11-11 16:47:19 +02:00
Jonathan Wakely 832ca6ac72 re PR libstdc++/64651 (std::rethrow_exception not found by ADL)
PR libstdc++/64651
	* libsupc++/exception_ptr.h (rethrow_exception): Add using-declaration
	to __exception_ptr namespace.
	* testsuite/18_support/exception_ptr/rethrow_exception.cc: Test ADL.
	Remove unnecessary test variables.

From-SVN: r230147
2015-11-11 10:08:23 +00:00
Jason Merrill 34148d68c7 * libsupc++/new: Declare sized deletes.
From-SVN: r229713
2015-11-03 11:43:54 -05:00
Jason Merrill b8fd7909c0 Implement N4514, C++ Extensions for Transactional Memory.
gcc/
	* builtins.def (BUILT_IN_ABORT): Add transaction_pure attribute.
gcc/c-family/
	* c-common.c (c_common_reswords): Add C++ TM TS keywords.
	(c_common_attribute_table): Add transaction_safe_dynamic.
	transaction_safe now affects type identity.
	(handle_tm_attribute): Handle transaction_safe_dynamic.
	* c-common.h (enum rid): Add RID_ATOMIC_NOEXCEPT,
	RID_ATOMIC_CANCEL, RID_SYNCHRONIZED.
	(OBJC_IS_CXX_KEYWORD): Add RID_SYNCHRONIZED.
	(D_TRANSMEM): New.
	* c-cppbuiltin.c (c_cpp_builtins): Define __cpp_transactional_memory.
	* c-pretty-print.c (pp_c_attributes_display): Don't print
	transaction_safe in C++.
gcc/c/
	* c-parser.c (c_lex_one_token): Handle @synchronized.
	* c-decl.c (match_builtin_function_types): A declaration of a built-in
	can change whether the function is transaction_safe.
gcc/cp/
	* cp-tree.h (struct cp_declarator): Add tx_qualifier field.
	(BCS_NORMAL, BCS_TRANSACTION): New enumerators.
	* lex.c (init_reswords): Limit TM kewords to -fgnu-tm.
	* parser.c (cp_lexer_get_preprocessor_token): Fix @synchronized.
	(make_call_declarator): Take tx_qualifier.
	(cp_parser_tx_qualifier_opt): New.
	(cp_parser_lambda_declarator_opt): Use it.
	(cp_parser_direct_declarator): Likewise.
	(cp_parser_statement): Handle atomic_noexcept, atomic_cancel.
	(cp_parser_compound_statement): Change in_try parameter to bcs_flags.
	(cp_parser_std_attribute): Map optimize_for_synchronized to
	transaction_callable.
	(cp_parser_transaction): Take the token.  Handle atomic_noexcept.
	* lambda.c (maybe_add_lambda_conv_op): Handle transaction-safety.
	* call.c (enum conversion_kind): Add ck_tsafe.
	(standard_conversion): Handle transaction-safety conversion.
	(convert_like_real, resolve_address_of_overloaded_function): Likewise.
	(check_methods): Diagnose transaction_safe_dynamic on non-virtual
	function.
	(look_for_tm_attr_overrides): Don't inherit transaction_safe_dynamic.
	* cvt.c (tx_safe_fn_type_p, tx_unsafe_fn_variant)
	(can_convert_tx_safety): New.
	* typeck.c (composite_pointer_type): Handle transaction-safety.
	* name-lookup.h (enum scope_kind): Add sk_transaction.
	* name-lookup.c (begin_scope): Handle it.
	* semantics.c (begin_compound_stmt): Pass it.
	* decl.c (check_previous_goto_1): Check it.
	(struct named_label_entry): Add in_transaction_scope.
	(poplevel_named_label_1): Set it.
	(check_goto): Check it.
	(duplicate_decls): A specialization can be transaction_safe
	independently of its template.
	(grokdeclarator): Handle tx-qualifier.
	* rtti.c (ptr_initializer): Handle transaction-safe.
	* search.c (check_final_overrider): Check transaction_safe_dynamic.
	Don't check transaction_safe.
	* mangle.c (write_function_type): Mangle transaction_safe here.
	(write_CV_qualifiers_for_type): Not here.
	(write_type): Preserve transaction_safe when stripping attributes.
	* error.c (dump_type_suffix): Print transaction_safe.
libiberty/
	* cp-demangle.c (d_cv_qualifiers): Dx means transaction_safe.
	(cplus_demangle_type): Let d_cv_qualifiers handle it.
	(d_dump, d_make_comp, has_return_type, d_encoding)
	(d_count_templates_scopes, d_print_comp_inner)
	(d_print_mod_list, d_print_mod, d_print_function_type)
	(is_ctor_or_dtor): Handle DEMANGLE_COMPONENT_TRANSACTION_SAFE.

From-SVN: r228462
2015-10-04 15:17:19 -04:00
Michael Haubenwallner 74b7ec8c45 libstdc++-v3/fragment.am (AM_CPPFLAGS): Add CPPFLAGS
2015-07-24  Michael Haubenwallner  <michael.haubenwallner@ssi-schaefer.com>

	* fragment.am (AM_CPPFLAGS): Add CPPFLAGS.
	* Makefile.in: Regenerate.
	* doc/Makefile.in: Regenerate.
	* 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++98/Makefile.in: Regenerate.
	* src/filesystem/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.

From-SVN: r226138
2015-07-24 07:05:19 +00:00
Uros Bizjak 53ac92c3e0 guard.cc (__test_and_acquire): Use __p after __atomic_load to avoid unused variable warning.
* libsupc++/guard.cc (__test_and_acquire): Use __p after __atomic_load
	to avoid unused variable warning.
	(__set_and_release): Use __p after __atomic_store to avoid unused
	variable warning.

From-SVN: r225298
2015-07-02 07:58:12 +02:00
Ramana Radhakrishnan 57e6d9be77 Use atomics in guard.cc.
This provides proper definitions for _GLIBCXX_READ_MEM_BARRIER and
_GLIBCXX_WRITE_MEM_BARRIER, rewrites the guards in terms of proper
atomic extensions and removes internal uses of
_GLIBCXX_READ_MEM_BARRIER and _GLIBCXX_WRITE_MEM_BARRIER and replaces
them with equivalent atomics.

2015-06-12  Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>

	PR target/66200
	PR c++/66192
	* * config/cpu/generic/atomic_word.h (_GLIBCXX_READ_MEM_BARRIER): Define
        (_GLIBCXX_WRITE_MEM_BARRIER): Likewise
        * include/bits/shared_ptr_base.h: Use ACQ_REL barrier.
        * include/ext/atomicity.h: Likewise.
        * include/tr1/shared_ptr.h: Likewise.
        * libsupc++/guard.cc (__test_and_acquire): Rewrite with atomics.
        Update comment.
        (__set_and_release): Likewise.
        * testsuite/20_util/shared_ptr/cons/43820_neg.cc (test01): Adjust for
	line numbers.
        * testsuite/20_util/shared_ptr/cons/void_neg.cc: Likewise.
        * testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc:
	Likewise.

From-SVN: r224411
2015-06-12 09:49:41 +00:00
Jason Merrill 4177264e09 del_opv.cc: Suppress -Wsized-deallocation.
* libsupc++/del_opv.cc: Suppress -Wsized-deallocation.
	* libsupc++/del_op.cc: Likewise.

From-SVN: r223488
2015-05-21 11:12:40 -04:00
Eric Botcazou 9b92a9f3b6 sjlj.m4: New file.
config/
	* sjlj.m4: New file.
libgcc/
	* configure.ac: Include config/sjlj.m4.
	Remove manual SJLJ check, add GCC_CHECK_SJLJ_EXCEPTIONS and adjust.
	* config.in: Regenerate.
	* configure: Likewise.
	* config.host: Replace enable_sjlj_exceptions by ac_cv_sjlj_exceptions.
libjava/
	* configure.ac: Include config/sjlj.m4.
	Remove manual SJLJ check, add GCC_CHECK_SJLJ_EXCEPTIONS and adjust.
	* include/config.h.in: Regenerate.
	* configure: Likewise.
	* exception.cc: Replace SJLJ_EXCEPTIONS by __USING_SJLJ_EXCEPTIONS__.
	* stacktrace.cc: Likewise.
	* include/default-signal.h: Likewise.
	* sysdep/i386/backtrace.h: Likewise.
libobjc/
	* configure.ac: Remove manual SJLJ check.
	* config.h.in: Regenerate.
	* configure: Likewise.
	* exception.c: Replace SJLJ_EXCEPTIONS by __USING_SJLJ_EXCEPTIONS__.
libstdc++-v3/
	* acinclude.m4 (GLIBCXX_ENABLE_SJLJ_EXCEPTIONS): Delete.
	* configure.ac: Remove GLIBCXX_ENABLE_SJLJ_EXCEPTIONS.
	* config.h.in: Regenerate.
	* configure: Likewise.
	* libsupc++/eh_personality.cc: Replace _GLIBCXX_SJLJ_EXCEPTIONS by
	__USING_SJLJ_EXCEPTIONS__.
	* libsupc++/eh_throw.cc: Likewise.
	* libsupc++/eh_ptr.cc: Likewise.
	* doc/html/manual/appendix_porting.html: Remove
	GLIBCXX_ENABLE_SJLJ_EXCEPTIONS
	* doc/xml/manual/build_hacking.xml: Likewise.
	* doc/html/manual/configure.html: Remove --enable-sjlj-exceptions.
	* doc/xml/manual/configure.xml: Likewise.

From-SVN: r223181
2015-05-13 21:15:31 +00:00
Michael Haubenwallner 6ef9367656 libstdc++: Bump to automake 1.11.6
2015-05-13  Michael Haubenwallner  <michael.haubenwallner@ssi-schaefer.com>

	* Makefile.in: Regenerated with automake-1.11.6.
	* aclocal.m4: Likewise.
	* 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: r223125
2015-05-13 10:51:03 +00:00
Jonathan Wakely 196e0493cb exception (uncaught_exceptions): Add comment.
* libsupc++/exception (uncaught_exceptions): Add comment. Reorder #if.
	* testsuite/18_support/uncaught_exceptions/uncaught_exceptions.cc:
	Use -std=gnu++1z. Check feature-test macro.

From-SVN: r222523
2015-04-28 13:07:40 +01:00
Federico Lenarduzzi 03e73da676 eh_catch.cc (uncaught_exception, [...]): Return false or zero if the library is built without exceptions.
2015-04-27  Federico Lenarduzzi  <federico.lenarduzzi@tallertechnologies.com>
	    Jonathan Wakely  <jwakely@redhat.com>

	* libsupc++/eh_catch.cc (uncaught_exception, uncaught_exceptions):
	Return false or zero if the library is built without exceptions.
	* libsupc++/eh_term_handler.cc: Disable verbose terminate handler if
	the library is built without exceptions.

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

From-SVN: r222484
2015-04-27 22:06:17 +01:00
Ville Voutilainen 03a16cc404 Add support for std::uncaught_exceptions.
2015-04-27  Ville Voutilainen  <ville.voutilainen@gmail.com>

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

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

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

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

From-SVN: r222480
2015-04-27 20:44:30 +01:00
Jonathan Wakely 95f2fd9c5d nested_exception.h: Do not try to derive from final classes.
* libsupc++/nested_exception.h: Do not try to derive from final
	classes.
	* testsuite/18_support/nested_exception/throw_with_nested.cc: Test
	final class.

From-SVN: r221476
2015-03-17 14:24:55 +00:00
Caroline Tice 8be349eea9 Committing generated configure & Makefile.in pieces of VTV Cygwin patch (from Patrick Wollgast).
Committing generated configure & Makefile.in pieces of
VTV Cygwin patch (from Patrick Wollgast).  Forgot to 
commit these with the rest of the patch.

From-SVN: r220254
2015-01-29 08:47:25 -08:00
Caroline Tice f7f049fa46 Committing VTV Cygwin patch for Patrick Wollgast
* gcc/config/i386/cygwin.h (STARTFILE_SPEC): Add vtv_start.o,
    if -fvtable-verify=preinit/std is used.
* gcc/config/i386/mingw-w64.h (STARTFILE_SPEC): Likewise.
* gcc/config/i386/mingw32.h (STARTFILE_SPEC): Likewise.
* gcc/config/i386/cygwin.h (ENDFILE_SPEC): Add vtv_end.o,
    if -fvtable-verify=preinit/std is used.
* gcc/config/i386/mingw32.h (ENDFILE_SPEC): Likewise.
* gcc/config/i386/cygwin.h (LIB_SPEC): Pass -lvtv and -lpsapi,
    if -fvtable-verify=preinit/std is used.
* gcc/config/i386/mingw-w64.h (LIB_SPEC): Likewise.
* gcc/config/i386/mingw32.h (LIB_SPEC): Likewise.

* gcc/cp/vtable-class-hierarchy.c (vtv_generate_init_routine): Add
    check for not TARGET_PECOFF at the VTV_PREINIT_PRIORITY checks.

* gcc/varasm.c (assemble_variable): Add code to properly set the comdat
    section and name for the .vtable_map_vars section in case the
    target is PE or COFF.


* libgcc/Makefile.in: Move rules to build vtv_*.o out of the check
    for CUSTOM_CRTSTUFF.
* libgcc/config.host (i[34567]86-*-cygwin*, x86_64-*-cygwin*, i[34567]86-*-mingw*)
    (x86_64-*-mingw*): Only add vtv_*.o to extra_parts if enable_vtable_verify.


* libstdc++-v3/acinclude.m4: Define VTV_CYGMIN.
* libstdc++-v3/configure: Regenerate.

* libstdc++-v3/libsupc++/Makefile.am: Add vtv_sources only to
    libsupc___la_SOURCES and libsupc__convenience_la_SOURCES if VTV_CYGMIN is
    not set.
* libstdc++-v3/libsupc++/Makefile.in: Regenerated.
* libstdc++-v3/libsupc++/vtv_stubs.cc: Add none weak declaration of every
    function for Cygwin and MinGW.

* libstdc++-v3/src/Makefile.am: Add libvtv.la to toolexeclib_LTLIBRARIES,
    if VTV_CYGMIN is set. Define libvtv_la_SOURCES, libvtv_la_LDFLAGS,
    libvtv_la_AM_CXXFLAGS and libvtv_la_LINK if VTV_CYGMIN is set.
* libstdc++-v3/src/Makefile.in: Regenerate.


* libvtv/Makefile.am : Add libvtv.la to toolexeclib_LTLIBRARIES, if VTV_CYGMIN
    is set. Define libvtv_la_LIBADD, libvtv_la_LDFLAGS, libvtv_stubs_la_LDFLAGS
    and libvtv_stubs_la_SOURCES if VTV_CYGMIN is set. Add obstac.c to
    libvtv_la_SOURCES if VTV_CYGMIN is set.
* libvtv/Makefile.in : Regenerate.
* libvtv/aclocal.m4 : Regenerate.
* libvtv/configure : Regenerate.
* libvtv/configure.ac : Add ACX_LT_HOST_FLAGS. Define VTV_CYGMIN.
* libvtv/configure.tgt : (x86_64-*-cygwin*, i?86-*-cygwin*, x86_64-*-mingw*)
    (i?86-*-mingw*): Add to supported targets.
* libvtv/vtv_fail.cc : Skip inclusion of execinfo.h on Cygwin and MinGW.
(log_error_message): Skip calls to backtrace and backtrace_symbols_fd on Cygwin
    and MinGW.
* libvtv/vtv_malloc.cc : Include windows.h and skip sys/mman.h inclusion on
    Cygwin and MinGW. Add sysconf port on Cygwin and MinGW.
(obstack_chunk_alloc): Exchange call to mmap with call to VirtualAlloc on Cygwin
    and MinGW.
(__vtv_malloc_init): Exchange call to sysconf with call to port of sysconf on
    Cygwin and MinGW.
* libvtv/vtv_malloc.h : Declare mprotect and define PROT_READ and PROT_WRITE on
    Cygwin and MinGW.
* libvtv/map.h : Include stdint.h on MinGW.
* libvtv/rts.cc : Include windows.h, winternl.h and psapi.h, skip include of
    execinfo.h, sys/mman.h and link.h on Cygwin and MinGW.
    Add port of __fortify_fail on Cygwin and MinGW.
    Change ElfW (Addr) to uintptr_t on Cygwin and MinGW.
(read_section_offset_and_length): Add port for Cygwin and MinGW
(iterate_modules): New function.
(vtv_unprotect_vtable_vars): Use iterate_modules instead of dl_iterate_phdr on
    Cygwin and MinGW.
(vtv_protect_vtable_vars): Likewise.
(count_all_pages): Likewise.
(dl_iterate_phdr_count_pages): Don't build on Cygwin and MinGW.
* libvtv/utils.cc : Include windows.h and skip execinfo.h inclusion on
    Cygwin and MinGW.
(__vtv_open_log): Exchange call to getuid and getpid with GetCurrentProcessId and
    adjust call to snprintf accordingly on Cygwin and MinGW.
    Adjust calls to mkdir on MinGW.
    Adjust call to open on Cygwin and MinGW.
(__vtv_add_to_log): Adjust call to snprintf on Cygwin and MinGW.
(__vtv_log_verification_failure): Don't generate a backtrace on Cygwin and MinGW.

From-SVN: r220232
2015-01-29 00:03:56 -08:00
Jonathan Wakely 739cdc9041 re PR libstdc++/64828 (libstdc++-v3/libsupc++/del_opvs.cc:30:1: warning: ‘void operator delete [](void*, std::size_t)’ is a usual (non-placement) deallocation function in C++14 (or with -fsized-deallocation) [-Wc++14-compat])
PR libstdc++/64828
	* libsupc++/Makefile.am: Compile del_opvs.cc as C++14.
	* libsupc++/Makefile.in: Regenerate.
	* src/c++11/Makefile.in: Regenerate.

From-SVN: r220207
2015-01-28 15:02:28 +00:00