Commit Graph

30 Commits

Author SHA1 Message Date
Jakub Jelinek 8d9254fc8a Update copyright years.
From-SVN: r279813
2020-01-01 12:51:42 +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
Jakub Jelinek a554497024 Update copyright years.
From-SVN: r267494
2019-01-01 13:31:55 +01:00
Jakub Jelinek 85ec4feb11 Update copyright years.
From-SVN: r256169
2018-01-03 11:03:58 +01: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 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
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 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
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 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
Jakub Jelinek 5624e564d2 Update copyright years.
From-SVN: r219188
2015-01-05 13:33:28 +01:00
Jonathan Wakely 2ce8cb99a6 re PR libstdc++/62154 (std::throw_with_nested should not require a polymorphic type)
PR libstdc++/62154
	* libsupc++/nested_exception.h (throw_with_nested, rethrow_if_nested):
	Rewrite to conform to C++11 requirements.
	* testsuite/18_support/nested_exception/62154.cc: New.

From-SVN: r214025
2014-08-15 16:22:44 +01:00
Richard Sandiford aa118a03c4 Update copyright years in libstdc++-v3/
From-SVN: r206301
2014-01-02 22:30:10 +00:00
Richard Sandiford 405feeb871 Update copyright in libstdc++-v3.
From-SVN: r195701
2013-02-03 17:54:05 +00:00
Jason Merrill 734f50238f * many: Replace uses of __GXX_EXPERIMENTAL_CXX0X__ with __cplusplus.
From-SVN: r193392
2012-11-10 12:27:22 -05:00
Paolo Carlini 8535715d0f re PR libstdc++/51438 (std::exception and derived classes are not compatible with std::nested_exception and C++11 in general)
2011-12-06  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/51438
	* libsupc++/nested_exception.h (nested_exception::~nested_exception):
	Declare noexcept.
	* libsupc++/nested_exception.cc: Adjust.
	* testsuite/18_support/nested_exception/51438.cc: New.
	* testsuite/18_support/nested_exception/throw_with_nested.cc: Adjust.
	* testsuite/18_support/nested_exception/rethrow_if_nested.cc:
	Likewise.

	* src/shared_ptr.cc: Use noexcept where appropriate.
	* include/std/system_error: Likewise.
	* include/std/functional: Likewise.
	* include/bits/shared_ptr_base.h: Likewise.
	* src/stdexcept.cc: Use _GLIBCXX_USE_NOEXCEPT where appropriate.
	* include/std/stdexcept: Likewise.
	* libsupc++/bad_cast.cc: Likewise.
	* libsupc++/bad_typeid.cc: Likewise.
	* libsupc++/eh_exception.cc: Likewise.
	* libsupc++/typeinfo: Likewise.
	* libsupc++/exception: Likewise.
	* libsupc++/eh_ptr.cc: Likewise.
	* libsupc++/bad_alloc.cc: Likewise.
	* libsupc++/exception_ptr.h: Likewise.

	* include/std/chrono: Use noexcept where appropriate.
	* src/chrono.cc: Likewise.

From-SVN: r182064
2011-12-06 20:03:25 +00:00
Benjamin Kosnik a152e96f01 acinclude.m4 (GLIBCXX_ENABLE_ATOMIC_BUILTINS): Remove size-specific macros.
2011-11-30  Benjamin Kosnik  <bkoz@redhat.com>

        * acinclude.m4 (GLIBCXX_ENABLE_ATOMIC_BUILTINS): Remove
        size-specific macros. _GLIBCXX_ATOMIC_BUILTINS_1,
        _GLIBCXX_ATOMIC_BUILTINS_2, _GLIBCXX_ATOMIC_BUILTINS_4,
        _GLIBCXX_ATOMIC_BUILTINS_8. Use _GLIBCXX_ATOMIC_BUILTINS to
        indicate use of C++11 atomic builtins.
        * config.h.in: Regenerate.
        * configure: Regenerate.
        * include/Makefile.am (bits_sup_headers): Add atomic_lockfree_defines.h.
        * include/Makefile.in: Regenerate.
        * libsupc++/Makefile.am: Compile C++11 support with -std=gnu++0x.
        * libsupc++/Makefile.in: Regenerate.

        * include/bits/atomic_base.h: Move lock-free property macros...
        * libsupc++/atomic_lockfree_defines.h: ...here.
        * include/std/future: Use C++11 macros.
        * libsupc++/eh_ptr.cc: Same.
        * libsupc++/eh_throw.cc: Same.
        * libsupc++/exception: Same.
        * libsupc++/exception_ptr.h: Same.
        * libsupc++/guard.cc: Same.
        * libsupc++/nested_exception.cc: Same.
        * libsupc++/nested_exception.h: Same.
        * src/future.cc: Same.

        * include/ext/atomicity.h: Use _GLIBCXX_ATOMIC_BUILTINS.

        * doc/doxygen/user.cfg.in
        * doc/xml/manual/concurrency_extensions.xml

        * testsuite/18_support/exception_ptr/lifespan.cc
        * testsuite/lib/libstdc++.exp

From-SVN: r181869
2011-12-01 02:20:32 +00:00
Jeffrey Yasskin 3c16cf8517 exception_ptr.h needs the forward declaration because it's included from...
exception_ptr.h needs the forward declaration because it's
included from <typeinfo> before <typeinfo> defines std::type_info.

Tested:
  bootstrap + make check-c++ on x86_64.

libstdc++-v3/ChangeLog:

2011-03-31  Jeffrey Yasskin  <jyasskin@google.com>

	* libsupc++/exception_ptr.h: Forward-declare std::type_info.
	* libsupc++/nested_exception.h (__throw_with_nested): Remove a
	redundant default argument from std::__throw_with_nested.

From-SVN: r171807
2011-03-31 23:56:01 +00:00
Benjamin Kosnik e95992339f Makefile.am: Add functional.cc, shared_ptr.cc.
2011-03-14  Benjamin Kosnik  <bkoz@redhat.com>

	* src/Makefile.am: Add functional.cc, shared_ptr.cc.
	* src/Makefile.in: Regenerate.
	* libsupc++/Makefile.am: Add nested_exception.cc.
	* libsupc++/Makefile.in: Regenerate.
	* src/system_error.cc: Add ctor and dtor definitions for error_category.
	* src/functional.cc: New. Add dtor definition for bad_function_call.
	* src/stdexcept.cc: Add dtor definitions for domain_error,
	invalid_argument, length_error, out_of_range, range_error,
	overflow_error, underflow_error.
	* src/future.cc: Add dtor definition for __future_base::_Result_base.
	* src/shared_ptr.cc: New. Add dtor definition for bad_weak_ptr.
	* src/thread.cc: Add dtor for thread::_Impl_base.
	* include/std/system_error: Adjust.
	* include/std/stdexcept: Same.
	* include/std/future: Same.
	* include/std/functional: Same.
	* include/std/thread: Same.
	* include/bits/shared_ptr_base.h: Same.
	* libsupc++/nested_exception.cc: New. Add dtor for nested_exception.
	* libsupc++/nested_exception.h: Adjust.
	* testsuite/20_util/shared_ptr/cons/43820_neg.cc: Adjust line numbers.
	* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same.
	* config/abi/pre/gnu.ver: Add new exports.

	* include/bits/regex_compiler.h: Nest namespace versioning.
	* include/bits/regex_grep_matcher.tcc: Same.
	* include/bits/regex_grep_matcher.h: Same.
	* include/bits/regex_cursor.h: Same.
	* include/bits/regex_nfa.h: Same.
	* include/bits/regex_nfa.tcc: Same.

From-SVN: r170975
2011-03-15 00:24:08 +00:00
Benjamin Kosnik 7c3e9502c3 re PR libstdc++/36104 (gnu-versioned-namespace is broken)
2011-01-14  Benjamin Kosnik  <bkoz@redhat.com>

	PR libstdc++/36104
	* include/Makefile.am (bits_sup_headers, stamp-bits-sup): New.
	* include/Makefile.in: Regenerate.
	* libsupc++/Makefile.am (std_HEADERS, bits_HEADERS): New.
	(install-stdHEADERS, install-bitsHEADERS): New.
	* libsupc++/Makefile.in: Regenerate.

	* include/bits/c++config: Update for inline namespaces.
	* libsupc++/cxxabi-forced.h: To...
	* libsupc++/cxxabi_forced.h: ...this.
	* libsupc++/hash_bytes.h: Separate file.
	* libsupc++/typeinfo: Use it.
	* libsupc++/exception: Adjust for bits subdirectory.
	* libsupc++/eh_aux_runtime.cc: Same.
	* libsupc++/eh_ptr.cc: Same.
	* libsupc++/new_op.cc: Same.
	* libsupc++/exception_defines.h: Same.
	* libsupc++/nested_exception.h: Same.
	* libsupc++/eh_terminate.cc: Same.
	* libsupc++/vec.cc: Same.
	* libsupc++/vterminate.cc: Same.
	* libsupc++/exception_ptr.h: Same.
	* libsupc++/eh_personality.cc: Same.
	* libsupc++/eh_call.cc: Same.
	* libsupc++/new_opnt.cc: Same.
	* libsupc++/hash_bytes.cc: Same.
	* config/cpu/arm/cxxabi_tweaks.h: Same.
	* config/cpu/generic/cxxabi_tweaks.h: Same.
	* libsupc++/cxxabi.h: Same. Consolidate _GLIBCXX_NOTHROW defines.
	* include/std/bitset: Same.
	* include/ext/vstring.tcc: Same.
	* include/bits/hashtable.h: Same.
	* include/bits/functional_hash.h: Same.
	* include/bits/hashtable_policy.h: Same.
	* include/bits/basic_string.h: Same.
	* include/bits/istream.tcc: Same.
	* include/bits/ostream.tcc: Same.
	* include/bits/algorithmfwd.h: Same.
	* include/bits/basic_string.tcc: Same.
	* include/bits/ostream_insert.h: Same.
	* include/bits/fstream.tcc: Same.
	* include/bits/functexcept.h: Same.

	* doc/doxygen/user.cfg.in: Adjust names.

	* testsuite/ext/profile/mutex_extensions_neg.cc: Adjust line numbers.

From-SVN: r168831
2011-01-15 00:27:10 +00:00
Benjamin Kosnik f910786b98 *: Use headername alias to associate private includes to public includes.
2010-11-18  Benjamin Kosnik  <bkoz@redhat.com>

	* config/*/*: Use headername alias to associate private includes
	to public includes.
	* include/*/*: Same.

	* scripts/run_doxygen: Update for doxygen 1.7.2.
	* doc/doxygen/user.cfg.in: Same.
	* doc/doxygen/TODO: Remove.

	* testsuite/*/std_c++0x_neg.cc: Adjust line number.

From-SVN: r168046
2010-12-19 09:21:16 +00:00
Paolo Carlini 2f95713bd9 nested_exception.h: Fix <bits/c++0x_warning.h> include.
2010-02-18  Paolo Carlini  <paolo.carlini@oracle.com>

	* libsupc++/nested_exception.h: Fix <bits/c++0x_warning.h> include.

From-SVN: r156867
2010-02-18 17:20:16 +00:00
Jason Merrill 4094aee8bf thread (~_Impl_base): Declare inline.
* include/std/thread (~_Impl_base): Declare inline.
	* libsupc++/nested_exception.h (~nested_exception): Likewise.

From-SVN: r156707
2010-02-11 14:00:13 -05:00
Jason Merrill f1c3cf3c93 PR c++/42983, core issue 906
PR c++/42983, core issue 906
	* method.c (defaultable_fn_check): Check virtualness.
	* include/std/thread (~_Impl_base): Move default out of line.
	* libsupc++/nested_exception.h (~nested_exception): Likewise.

From-SVN: r156672
2010-02-10 16:48:35 -05:00
Benjamin Kosnik 8eead16e5e user.cfg.in: Regenerate, add files.
2009-11-09  Benjamin Kosnik  <bkoz@redhat.com>

	* doc/doxygen/user.cfg.in: Regenerate, add files.
	* libsupc++/eh_ptr.cc: Format.
	* libsupc++/exception_ptr.h: Same.
	* libsupc++/cxxabi.h(recursive_init_error): Move declaration here.
	* libsupc++/guard.cc: From here.
	* libsupc++/nested_exception.h: Add markup.

From-SVN: r154054
2009-11-09 22:09:30 +00:00
Jason Merrill 20f2653ef0 PR c++/38796, Core issue 906
PR c++/38796, Core issue 906
gcc/cp
	* cp-tree.h (DECL_DEFAULTED_OUTSIDE_CLASS_P): New.
	(DECL_DEFAULTED_IN_CLASS_P): New.
	* class.c (user_provided_p): Non-static.
	(check_methods): Use it.
	(check_bases_and_members): Check defaulted fns.
	(defaultable_fn_p): Move and rename to...
	* method.c (defaultable_fn_check): ...this.
	(defaulted_late_check): New.
	* pt.c (tsubst_decl): Call it.
	* decl2.c (grokfield): Adjust.
	* decl.c (cp_finish_decl): Adjust.
	(grok_special_member_properties): Use user_provided_p.
libstdc++-v3
	* include/std/future (~Future_result_base): Default outside class
	body.
	* include/std/system_error (error_category()): Likewise.
	* libsupc++/nested_exception.h (nested_exception): Remove
	exception specifications from defaulted methods.

From-SVN: r153565
2009-10-26 15:07:14 -04:00
Jonathan Wakely 182da14a62 exception: Include nested_exception.h in C++0x mode.
2009-05-12  Jonathan Wakely  <jwakely.gcc@gmail.com>

	* libsupc++/exception: Include nested_exception.h in C++0x mode.
	* libsupc++/nested_exception.h: New.
	* libsupc++/Makefile.am: Add new header.
	* libsupc++/Makefile.in: Regenerate.
	* testsuite/18_support/nested_exception/rethrow_nested.cc: New.
	* testsuite/18_support/nested_exception/throw_with_nested.cc: New.
	* testsuite/18_support/nested_exception/cons.cc: New.
	* testsuite/18_support/nested_exception/nested_ptr.cc: New.
	* testsuite/18_support/nested_exception/rethrow_if_nested.cc: New.
	* doc/xml/manual/status_cxx200x.xml: Adjust.

From-SVN: r147446
2009-05-12 22:08:00 +01:00