Commit Graph

41 Commits

Author SHA1 Message Date
Jakub Jelinek
f8c32184b8 libstdc++: Use gnu_inline attribute on constexpr exception methods [PR123183]
As mentioned in
https://gcc.gnu.org/pipermail/gcc-patches/2026-January/704712.html
in the gnu::constexpr_only thread, gnu::gnu_inline attribute actually
seems to work for most of what we need for C++26 constexpr exceptions
(i.e. when we want out of line bodies for C++ < 26 and need to use
constexpr for C++26, yet don't want for reasons mentioned in those
two PRs the bodies of those constexpr methods to be emitted inline).
Unfortunately clang++ doesn't handle it 100% properly and requires
the redundant inline keyword to make it work (even when the methods
are constexpr and thus implicilty inline), g++ doesn't require that,
so the patch adds also the redundant inline keywords and not just
the [[__gnu__::__gnu_inline__]] attribute.
This way if something wants to inline those functions it can, but
if their address is taken, we just rely on libstdc++.{so,a} to provide
those (which it does as before because those TUs are compiled with
older -std= modes).
The earlier r16-6477-gd5743234731 commit made sure gnu::gnu_inline
constexpr virtual methods can be key methods, so vtables and rtti can
be emitted only in the TU defining non-gnu_inline versions of those.

2026-01-07  Jakub Jelinek  <jakub@redhat.com>

	PR libstdc++/123183
	PR libstdc++/123326
	* libsupc++/exception (std::bad_exception::~bad_exception(),
	std::bad_exception::what()): Add inline keyword and
	[[__gnu__::__gnu_inline__]] attribute to the C++26 constexpr
	exceptions definitions.
	* libsupc++/exception.h (std::exception::~exception(),
	std::exception::what()): Likewise.
	* libsupc++/exception_ptr.h (std::exception_ptr::exception_ptr(void*)):
	Likewise.
	* libsupc++/nested_exception.h
	(std::nested_exception::~nested_exception()): Likewise.
	* libsupc++/typeinfo (std::bad_cast::~bad_cast(),
	std::bad_cast::what(), std::bad_typeid::~bad_typeid(),
	std::bad_typeid::what()): Likewise.
	* include/bits/new_except.h (std::bad_alloc::~bad_alloc(),
	std::bad_alloc::what(),
	std::bad_array_new_length::~bad_array_new_length(),
	std::bad_array_new_length::what()): Likewise.
	* include/bits/stdexcept_except.h
	(std::logic_error::logic_error(const string&),
	std::logic_error::logic_error(const char*),
	std::logic_error::~logic_error(), std::logic_error::what(),
	std::domain_error::domain_error(const string&),
	std::domain_error::domain_error(const char*),
	std::invalid_argument::invalid_argument(const string&),
	std::invalid_argument::invalid_argument(const char*),
	std::length_error::length_error(const string&),
	std::length_error::length_error(const char*),
	std::out_of_range::out_of_range(const string&),
	std::out_of_range::out_of_range(const char*),
	std::runtime_error::runtime_error(const string&),
	std::runtime_error::runtime_error(const char*),
	std::runtime_error::~runtime_error(), std::runtime_error::what(),
	std::overflow_error::overflow_error(const string&),
	std::overflow_error::overflow_error(const char*),
	std::overflow_error::~overflow_error(),
	std::underflow_error::underflow_error(const string&),
	std::underflow_error::underflow_error(const char*),
	std::underflow_error::~underflow_error()): Likewise.
	(std::domain_error::~domain_error(),
	std::invalid_argument::~invalid_argument(),
	std::length_error::~length_error(),
	std::out_of_range::~out_of_range()): Likewise.  Also change
	_GLIBCXX_NOTHROW to noexcept on those definitions.
2026-01-07 15:07:33 +01:00
Jakub Jelinek
254a858ae7 Update copyright years. 2026-01-02 09:56:11 +01:00
Jakub Jelinek
baaee10123 c++, libstdc++: Implement C++26 P3068R5 - constexpr exceptions [PR117785]
The following patch implements the C++26 P3068R5 - constexpr exceptions
paper.

As the IL cxx_eval_constant* functions process already contains the low
level calls like __cxa_{allocate,free}_exception, __cxa_{,re}throw etc.,
the patch just makes 10 extern "C" __cxa_* functions magic builtins which
during constant evaluation pretend to be constexpr even when not declared
so and handle them directly, plus does the same for 3 std namespace
functions - std::uncaught_exceptions, std::current_exception and
std::rethrow_exception and adds one new FE builtin -
__builtin_eh_ptr_adjust_ref which the library can use instead of the
_M_addref and _M_release out of line methods (this one instead of
recognizing _M_* as magic too because those are clearly specific to
libstdc++ and e.g. libc++ could use something else).

The patch uses magic VAR_DECLs with heap_{uninit_,,deleted_}identifier
DECL_NAME like for operator new/delete for objects allocated with
__cxa_allocate_exception, just sets their DECL_LANG_SPECIFIC so that
we can track their reference count as well (with std::exception_ptr
the same exception object can be referenced multiple times and we want
to destruct and free only when it reaches zero refcount).

For uncaught exceptions being propagated, the patch uses new kind of
*jump_target, which is that magic VAR_DECL described above.
The largest change in the patch is making jump_target argument non-optional
in cxa_eval_constant_exception and all functions it calls that need it.
This is because exceptions can be thrown from pretty much everywhere, e.g.
binary expression can throw in either operand.  And the patch also adds
if (*jump_target) return NULL_TREE; or similar in many spots, so that we
don't crash because cxx_eval_constant_expression returned NULL_TREE
somewhere before actually trying to use it and so that we don't uselessly
dive into other operands etc.
Note, with statement expressions actually this was something we just didn't
handle correctly before, one can validly have:
  a = ({ if (x) return 42; 12; }) + b;
or in the other operand, or break/continue instead of return if it is
somewhere in a loop/switch; and it isn't ok to branch from one operand to
another one through some kind of goto.

On the potential_constant_expression_1 side, important change was to
set *jump_target conservatively on calls that could throw for C++26 (the
patch uses magic void_node for potential_constant_expression* instead of
VAR_DECL, so that we don't have to create new VAR_DECLs there uselessly).
Without that change, several methods in libstdc++ wouldn't work correctly.
I'm not sure what exactly potential_constant_expression_1 maps to in the
C++26 standard wording now and whether doing that is ok, because basically
after the first call to non-noexcept function it stops checking stuff.

And, in some spots where I know potential_constant_expression_1 didn't
check some subexpressions (e.g. the EH only cleanups or TRY_BLOCK handlers)
I've added *potential_constant_expression* calls during cxx_eval_constant*,
not sure if I need to do that because potential_constant_expression_1 is
very conservative and just doesn't recurse on subexpressions in many cases.

2025-07-10  Jakub Jelinek  <jakub@redhat.com>

	PR c++/117785
gcc/c-family/
	* c-cppbuiltin.cc (c_cpp_builtins): Predefine
	__cpp_constexpr_exceptions=202411L for C++26.
gcc/cp/
	* constexpr.cc: Implement C++26 P3068R5 - constexpr exceptions.
	(class constexpr_global_ctx): Add caught_exceptions and
	uncaught_exceptions members.
	(constexpr_global_ctx::constexpr_global_ctx): Initialize
	uncaught_exceptions.
	(returns, breaks, continues, switches): Move earlier.
	(throws): New function.
	(exception_what_str, diagnose_std_terminate,
	diagnose_uncaught_exception): New functions.
	(enum cxa_builtin): New type.
	(cxx_cxa_builtin_fn_p, cxx_eval_cxa_builtin_fn): New functions.
	(cxx_eval_builtin_function_call): Add jump_target argument.  Call
	cxx_eval_cxa_builtin_fn for __builtin_eh_ptr_adjust_ref.  Adjust
	cxx_eval_constant_expression calls, if it results in jmp_target,
	set *jump_target to it and return.
	(cxx_bind_parameters_in_call): Add jump_target argument.  Pass
	it through to cxx_eval_constant_expression.  If it sets *jump_target,
	break.
	(fold_operand): Adjust cxx_eval_constant_expression caller.
	(cxx_eval_assert): Likewise.  If it set jmp_target, return true.
	(cxx_eval_internal_function): Add jump_target argument.  Pass it
	through to cxx_eval_constant_expression.  Return early if *jump_target
	after recursing on args.
	(cxx_eval_dynamic_cast_fn): Likewise.  Don't set reference_p for
	C++26 with -fexceptions.
	(cxx_eval_thunk_call): Add jump_target argument.  Pass it through
	to cxx_eval_constant_expression.
	(cxx_set_object_constness): Likewise.  Don't set TREE_READONLY if
	throws (jump_target).
	(cxx_eval_call_expression): Add jump_target argument.  Pass it
	through to cxx_eval_internal_function, cxx_eval_builtin_function_call,
	cxx_eval_thunk_call, cxx_eval_dynamic_cast_fn and
	cxx_set_object_constness.  Pass it through also
	cxx_eval_constant_expression on arguments, cxx_bind_parameters_in_call
	and cxx_fold_indirect_ref and for those cases return early
	if *jump_target.  Call cxx_eval_cxa_builtin_fn for cxx_cxa_builtin_fn_p
	functions.  For cxx_eval_constant_expression on body, pass address of
	cleared jmp_target automatic variable, if it throws propagate
	to *jump_target and make it non-cacheable.  For C++26 don't diagnose
	calls to non-constexpr functions before cxx_bind_parameters_in_call
	could report some argument throwing an exception.
	(cxx_eval_unary_expression): Add jump_target argument.  Pass it
	through to cxx_eval_constant_expression and return early
	if *jump_target after the call.
	(cxx_fold_pointer_plus_expression): Likewise.
	(cxx_eval_binary_expression): Likewise and similarly for
	cxx_fold_pointer_plus_expression call.
	(cxx_eval_conditional_expression): Pass jump_target to
	cxx_eval_constant_expression on first operand and return early
	if *jump_target after the call.
	(cxx_eval_vector_conditional_expression): Add jump_target argument.
	Pass it through to cxx_eval_constant_expression for all 3 arguments
	and return early if *jump_target after any of those calls.
	(get_array_or_vector_nelts): Add jump_target argument.  Pass it
	through to cxx_eval_constant_expression.
	(eval_and_check_array_index): Add jump_target argument.  Pass it
	through to cxx_eval_constant_expression calls and return early after
	each of them if *jump_target.
	(cxx_eval_array_reference): Likewise.
	(cxx_eval_component_reference): Likewise.
	(cxx_eval_bit_field_ref): Likewise.
	(cxx_eval_bit_cast): Likewise.  Assert CHECKING_P call doesn't
	throw or return.
	(cxx_eval_logical_expression): Add jump_target argument.  Pass it
	through to cxx_eval_constant_expression calls and return early after
	each of them if *jump_target.
	(cxx_eval_bare_aggregate): Likewise.
	(cxx_eval_vec_init_1): Add jump_target argument.  Pass it through
	to cxx_eval_bare_aggregate and recursive call.  Pass it through
	to get_array_or_vector_nelts and cxx_eval_constant_expression
	and return early after it if *jump_target.
	(cxx_eval_vec_init): Add jump_target argument.  Pass it through
	to cxx_eval_constant_expression and cxx_eval_vec_init_1.
	(cxx_union_active_member): Add jump_target argument.  Pass it
	through to cxx_eval_constant_expression and return early after it
	if *jump_target.
	(cxx_fold_indirect_ref_1): Add jump_target argument.  Pass it
	through to cxx_union_active_member and recursive calls.
	(cxx_eval_indirect_ref): Add jump_target argument.  Pass it through
	to cxx_fold_indirect_ref_1 calls and to recursive call, in which
	case return early after it if *jump_target.
	(cxx_fold_indirect_ref): Add jump_target argument.  Pass it through
	to cxx_fold_indirect_ref and cxx_eval_constant_expression calls and
	return early after those if *jump_target.
	(cxx_eval_trinary_expression): Add jump_target argument.  Pass it
	through to cxx_eval_constant_expression calls and return early after
	those if *jump_target.
	(cxx_eval_store_expression): Add jump_target argument.  Pass it
	through to cxx_eval_constant_expression and eval_and_check_array_index
	calls and return early after those if *jump_target.
	(cxx_eval_increment_expression): Add jump_target argument.  Pass it
	through to cxx_eval_constant_expression calls and return early after
	those if *jump_target.
	(label_matches): Handle VAR_DECL case.
	(cxx_eval_statement_list): Remove local_target variable and
	!jump_target handling.  Handle throws (jump_target) like returns or
	breaks.
	(cxx_eval_loop_expr): Remove local_target variable and !jump_target
	handling.  Pass it through to cxx_eval_constant_expression.  Handle
	throws (jump_target) like returns.
	(cxx_eval_switch_expr): Pass jump_target through to
	cxx_eval_constant_expression on cond, return early after it
	if *jump_target.
	(build_new_constexpr_heap_type): Add jump_target argument.  Pass it
	through to cxx_eval_constant_expression calls, return early after
	those if *jump_target.
	(merge_jump_target): New function.
	(cxx_eval_constant_expression): Make jump_target argument no longer
	defaulted, don't test jump_target for NULL.  Pass jump_target
	through to recursive calls, cxx_eval_call_expression,
	cxx_eval_store_expression, cxx_eval_indirect_ref,
	cxx_eval_unary_expression, cxx_eval_binary_expression,
	cxx_eval_logical_expression, cxx_eval_array_reference,
	cxx_eval_component_reference, cxx_eval_bit_field_ref,
	cxx_eval_vector_conditional_expression, cxx_eval_bare_aggregate,
	cxx_eval_vec_init, cxx_eval_trinary_expression, cxx_fold_indirect_ref,
	build_new_constexpr_heap_type, cxx_eval_increment_expression,
	cxx_eval_bit_cast and return earlyu after some of those
	if *jump_target as needed.
	(cxx_eval_constant_expression) <case TARGET_EXPR>: For C++26 push
	also CLEANUP_EH_ONLY cleanups, with NULL_TREE marker after them.
	(cxx_eval_constant_expression) <case RETURN_EXPR>: Don't
	override *jump_target if throws (jump_target).
	(cxx_eval_constant_expression) <case TRY_CATCH_EXPR, case TRY_BLOCK,
	case MUST_NOT_THROW_EXPR, case TRY_FINALLY_EXPR, case CLEANUP_STMT>:
	Handle C++26 constant expressions.
	(cxx_eval_constant_expression) <case CLEANUP_POINT_EXPR>: For C++26
	with throws (jump_target) evaluate the CLEANUP_EH_ONLY cleanups as
	well, and if not throws (jump_target) skip those.  Set *jump_target
	if some of the cleanups threw.
	(cxx_eval_constant_expression) <case THROW_EXPR>: Recurse on operand
	for C++26.
	(cxx_eval_outermost_constant_expr): Diagnose uncaught exceptions both
	from main expression and cleanups, diagnose also
	break/continue/returns from the main expression.  Handle
	CLEANUP_EH_ONLY cleanup markers.  Don't diagnose mutable poison stuff
	if non_constant_p.  Use different diagnostics for non-deleted heap
	allocations if they were allocated by __cxa_allocate_exception.
	(callee_might_throw): New function.
	(struct check_for_return_continue_data): Add could_throw field.
	(check_for_return_continue): Handle AGGR_INIT_EXPR and CALL_EXPR and
	set d->could_throw if they could throw.
	(potential_constant_expression_1): For CALL_EXPR allow
	cxx_dynamic_cast_fn_p calls.  For C++26 set *jump_target to void_node
	for calls that could throw.  For C++26 if call to non-constexpr call
	is seen, try to evaluate arguments first and if they could throw,
	don't diagnose call to non-constexpr function nor return false.
	Adjust check_for_return_continue_data initializers and
	set *jump_target to void_node if data.could_throw_p.  For C++26
	recurse on THROW_EXPR argument.  Add comment explaining TRY_BLOCK
	handling with C++26 exceptions.  Handle throws like returns in some
	cases.
	* cp-tree.h (MUST_NOT_THROW_NOEXCEPT_P, MUST_NOT_THROW_THROW_P,
	MUST_NOT_THROW_CATCH_P, DECL_EXCEPTION_REFCOUNT): Define.
	(DECL_LOCAL_DECL_P): Fix comment typo, VARIABLE_DECL -> VAR_DECL.
	(enum cp_built_in_function): Add CP_BUILT_IN_EH_PTR_ADJUST_REF,
	(handler_match_for_exception_type): Declare.
	* call.cc (handler_match_for_exception_type): New function.
	* except.cc (initialize_handler_parm): Set MUST_NOT_THROW_CATCH_P
	on newly created MUST_NOT_THROW_EXPR.
	(begin_eh_spec_block): Set MUST_NOT_THROW_NOEXCEPT_P.
	(wrap_cleanups_r): Set MUST_NOT_THROW_THROW_P.
	(build_throw): Add another TARGET_EXPR whose scope spans
	until after the __cxa_throw call and copy pointer value from ptr
	to it and use it in __cxa_throw argument.
	* tree.cc (builtin_valid_in_constant_expr_p): Handle
	CP_BUILT_IN_EH_PTR_ADJUST_REF.
	* decl.cc (cxx_init_decl_processing): Initialize
	__builtin_eh_ptr_adjust_ref FE builtin.
	* pt.cc (tsubst_stmt) <case MUST_NOT_THROW_EXPR>: Copy the
	MUST_NOT_THROW_NOEXCEPT_P, MUST_NOT_THROW_THROW_P and
	MUST_NOT_THROW_CATCH_P flags.
	* cp-gimplify.cc (cp_gimplify_expr) <case CALL_EXPR>: Error on
	non-folded CP_BUILT_IN_EH_PTR_ADJUST_REF calls.
gcc/testsuite/
	* g++.dg/cpp0x/constexpr-ellipsis2.C: Expect different diagnostics for
	C++26.
	* g++.dg/cpp0x/constexpr-throw.C: Likewise.
	* g++.dg/cpp1y/constexpr-84192.C: Expect different diagnostics.
	* g++.dg/cpp1y/constexpr-throw.C: Expect different diagnostics for
	C++26.
	* g++.dg/cpp1z/constexpr-asm-5.C: Likewise.
	* g++.dg/cpp26/constexpr-eh1.C: New test.
	* g++.dg/cpp26/constexpr-eh2.C: New test.
	* g++.dg/cpp26/constexpr-eh3.C: New test.
	* g++.dg/cpp26/constexpr-eh4.C: New test.
	* g++.dg/cpp26/constexpr-eh5.C: New test.
	* g++.dg/cpp26/constexpr-eh6.C: New test.
	* g++.dg/cpp26/constexpr-eh7.C: New test.
	* g++.dg/cpp26/constexpr-eh8.C: New test.
	* g++.dg/cpp26/constexpr-eh9.C: New test.
	* g++.dg/cpp26/constexpr-eh10.C: New test.
	* g++.dg/cpp26/constexpr-eh11.C: New test.
	* g++.dg/cpp26/constexpr-eh12.C: New test.
	* g++.dg/cpp26/constexpr-eh13.C: New test.
	* g++.dg/cpp26/constexpr-eh14.C: New test.
	* g++.dg/cpp26/constexpr-eh15.C: New test.
	* g++.dg/cpp26/feat-cxx26.C: Change formatting in __cpp_pack_indexing
	and __cpp_pp_embed test.  Add __cpp_constexpr_exceptions test.
	* g++.dg/cpp26/static_assert1.C: Expect different diagnostics for
	C++26.
	* g++.dg/cpp2a/consteval34.C: Likewise.
	* g++.dg/cpp2a/consteval-memfn1.C: Likewise.
	* g++.dg/cpp2a/constexpr-dynamic4.C: For C++26 add std::exception and
	std::bad_cast definitions and expect different diagnostics.
	* g++.dg/cpp2a/constexpr-dynamic6.C: Likewise.
	* g++.dg/cpp2a/constexpr-dynamic7.C: Likewise.
	* g++.dg/cpp2a/constexpr-dynamic8.C: Likewise.
	* g++.dg/cpp2a/constexpr-dynamic9.C: Likewise.
	* g++.dg/cpp2a/constexpr-dynamic11.C: Likewise.
	* g++.dg/cpp2a/constexpr-dynamic14.C: Likewise.
	* g++.dg/cpp2a/constexpr-dynamic18.C: Likewise.
	* g++.dg/cpp2a/constexpr-new27.C: New test.
	* g++.dg/cpp2a/constexpr-typeid5.C: New test.
libstdc++-v3/
	* include/bits/version.def (constexpr_exceptions): New.
	* include/bits/version.h: Regenerate.
	* libsupc++/exception (std::bad_exception::bad_exception): Add
	_GLIBCXX26_CONSTEXPR.
	(std::bad_exception::~bad_exception, std::bad_exception::what): For
	C++26 add constexpr and define inline.
	* libsupc++/exception.h (std::exception::exception,
	std::exception::operator=): Add _GLIBCXX26_CONSTEXPR.
	(std::exception::~exception, std::exception::what): For C++26 add
	constexpr and define inline.
	* libsupc++/exception_ptr.h (std::make_exception_ptr): Add
	_GLIBCXX26_CONSTEXPR.  For if consteval use just throw with
	current_exception() in catch.
	(std::exception_ptr::exception_ptr(void*)): For C++26 add constexpr
	and define inline.
	(std::exception_ptr::exception_ptr()): Add _GLIBCXX26_CONSTEXPR.
	(std::exception_ptr::exception_ptr(const exception_ptr&)): Likewise.
	Use __builtin_eh_ptr_adjust_ref if consteval and compiler has it
	instead of _M_addref.
	(std::exception_ptr::exception_ptr(nullptr_t)): Add
	_GLIBCXX26_CONSTEXPR.
	(std::exception_ptr::exception_ptr(exception_ptr&&)): Likewise.
	(std::exception_ptr::operator=): Likewise.
	(std::exception_ptr::~exception_ptr): Likewise.  Use
	__builtin_eh_ptr_adjust_ref if consteval and compiler has it
	instead of _M_release.
	(std::exception_ptr::swap): Add _GLIBCXX26_CONSTEXPR.
	(std::exception_ptr::operator bool): Likewise.
	(std::exception_ptr::operator==): Likewise.
	* libsupc++/nested_exception.h
	(std::nested_exception::nested_exception): Add _GLIBCXX26_CONSTEXPR.
	(std::nested_exception::operator=): Likewise.
	(std::nested_exception::~nested_exception): For C++26 add constexpr
	and define inline.
	(std::nested_exception::rethrow_if_nested): Add _GLIBCXX26_CONSTEXPR.
	(std::nested_exception::nested_ptr): Likewise.
	(std::_Nested_exception::_Nested_exception): Likewise.
	(std::throw_with_nested, std::rethrow_if_nested): Likewise.
	* libsupc++/new (std::bad_alloc::bad_alloc): Likewise.
	(std::bad_alloc::operator=): Likewise.
	(std::bad_alloc::~bad_alloc): For C++26 add constexpr and define
	inline.
	(std::bad_alloc::what): Likewise.
	(std::bad_array_new_length::bad_array_new_length): Add
	_GLIBCXX26_CONSTEXPR.
	(std::bad_array_new_length::~bad_array_new_length): For C++26 add
	constexpr and define inline.
	(std::bad_array_new_length::what): Likewise.
	* libsupc++/typeinfo (std::bad_cast::bad_cast): Add
	_GLIBCXX26_CONSTEXPR.
	(std::bad_cast::~bad_cast): For C++26 add constexpr and define inline.
	(std::bad_cast::what): Likewise.
	(std::bad_typeid::bad_typeid): Add _GLIBCXX26_CONSTEXPR.
	(std::bad_typeid::~bad_typeid): For C++26 add constexpr and define
	inline.
	(std::bad_typeid::what): Likewise.
2025-07-10 23:32:06 +02:00
Jakub Jelinek
6441eb6dc0 Update copyright years. 2025-01-02 11:59:57 +01:00
Jakub Jelinek
a945c346f5 Update copyright years. 2024-01-03 12:19:35 +01:00
Jakub Jelinek
83ffe9cde7 Update copyright years. 2023-01-16 11:52:17 +01:00
Jonathan Wakely
c470f3ea86 libstdc++: Make std::rethrow_if_nested work without RTTI
This allows std::rethrow_if_nested to work with -fno-rtti by not
attempting the dynamic_cast if it requires RTTI, since that's ill-formed
with -fno-rtti. The cast will still work if a static upcast to
std::nested_exception is allowed.

Also use if-constexpr to avoid the compile-time overload resolution (and
SFINAE) and run-time dispatching for std::rethrow_if_nested and
std::throw_with_nested.

Also add better doxygen comments throughout the file.

libstdc++-v3/ChangeLog:

	* libsupc++/nested_exception.h (throw_with_nested) [C++17]: Use
	if-constexpr instead of tag dispatching.
	(rethrow_if_nested) [C++17]: Likewise.
	(rethrow_if_nested) [!__cpp_rtti]: Do not use dynamic_cast if it
	would require RTTI.
	* testsuite/18_support/nested_exception/rethrow_if_nested-term.cc:
	New test.
2022-05-13 20:39:59 +01:00
Jonathan Wakely
488d268728 libstdc++: Do not use #include inside push visibility scope [PR99871]
libstdc++-v3/ChangeLog:

	PR libstdc++/99871
	* include/bits/specfun.h: Use visibility attribute on namespace,
	instead of pragma push/pop.
	* libsupc++/compare: Likewise.
	* libsupc++/exception: Likewise.
	* libsupc++/exception.h: Likewise.
	* libsupc++/exception_ptr.h: Likewise.
	* libsupc++/initializer_list: Likewise.
	* libsupc++/nested_exception.h: Likewise.
2022-05-06 14:43:39 +01:00
Jakub Jelinek
7adcbafe45 Update copyright years. 2022-01-03 10:42:10 +01:00
Jonathan Wakely
f0b883464c libstdc++: Fix doxygen markup for group close commands
A change in Doxygen 1.8.16 means that "// @}" is no longer recognized by
Doxygen, so doesn't close a @{ group. A "///" comment needs to be used.

libstdc++-v3/ChangeLog:

	* include/bits/atomic_base.h: Fix doxygen group close.
	* include/bits/basic_ios.h: Likewise.
	* include/bits/forward_list.h: Likewise.
	* include/bits/fs_dir.h: Likewise.
	* include/bits/fs_ops.h: Likewise.
	* include/bits/fs_path.h: Likewise.
	* include/bits/functional_hash.h: Likewise.
	* include/bits/gslice.h: Likewise.
	* include/bits/gslice_array.h: Likewise.
	* include/bits/hashtable_policy.h: Likewise.
	* include/bits/indirect_array.h: Likewise.
	* include/bits/locale_classes.h: Likewise.
	* include/bits/locale_facets.h: Likewise.
	* include/bits/locale_facets_nonio.h: Likewise.
	* include/bits/mask_array.h: Likewise.
	* include/bits/refwrap.h: Likewise.
	* include/bits/regex.h: Likewise.
	* include/bits/regex_automaton.h: Likewise.
	* include/bits/regex_compiler.h: Likewise.
	* include/bits/regex_constants.h: Likewise.
	* include/bits/regex_error.h: Likewise.
	* include/bits/regex_executor.h: Likewise.
	* include/bits/regex_scanner.h: Likewise.
	* include/bits/shared_ptr.h: Likewise.
	* include/bits/shared_ptr_atomic.h: Likewise.
	* include/bits/shared_ptr_base.h: Likewise.
	* include/bits/slice_array.h: Likewise.
	* include/bits/specfun.h: Likewise.
	* include/bits/std_function.h: Likewise.
	* include/bits/std_mutex.h: Likewise.
	* include/bits/stl_deque.h: Likewise.
	* include/bits/stl_iterator.h: Likewise.
	* include/bits/stl_iterator_base_types.h: Likewise.
	* include/bits/stl_map.h: Likewise.
	* include/bits/stl_multimap.h: Likewise.
	* include/bits/stl_multiset.h: Likewise.
	* include/bits/stl_numeric.h: Likewise.
	* include/bits/stl_pair.h: Likewise.
	* include/bits/stl_set.h: Likewise.
	* include/bits/stl_uninitialized.h: Likewise.
	* include/bits/stream_iterator.h: Likewise.
	* include/bits/streambuf_iterator.h: Likewise.
	* include/bits/unique_ptr.h: Likewise.
	* include/bits/unordered_map.h: Likewise.
	* include/bits/unordered_set.h: Likewise.
	* include/decimal/decimal: Likewise.
	* include/experimental/any: Likewise.
	* include/experimental/array: Likewise.
	* include/experimental/bits/fs_dir.h: Likewise.
	* include/experimental/bits/fs_fwd.h: Likewise.
	* include/experimental/bits/fs_ops.h: Likewise.
	* include/experimental/bits/fs_path.h: Likewise.
	* include/experimental/buffer: Likewise.
	* include/experimental/internet: Likewise.
	* include/experimental/optional: Likewise.
	* include/experimental/propagate_const: Likewise.
	* include/experimental/socket: Likewise.
	* include/ext/pb_ds/assoc_container.hpp: Likewise.
	* include/ext/pb_ds/detail/priority_queue_base_dispatch.hpp:
	Likewise.
	* include/ext/pb_ds/detail/tree_policy/node_metadata_selector.hpp: Likewise.
	* include/ext/pb_ds/detail/trie_policy/node_metadata_selector.hpp: Likewise.
	* include/ext/pb_ds/detail/types_traits.hpp: Likewise.
	* include/ext/pb_ds/exception.hpp: Likewise.
	* include/ext/pb_ds/priority_queue.hpp: Likewise.
	* include/ext/pb_ds/tag_and_trait.hpp: Likewise.
	* include/ext/random: Likewise.
	* include/std/any: Likewise.
	* include/std/atomic: Likewise.
	* include/std/bitset: Likewise.
	* include/std/chrono: Likewise.
	* include/std/complex: Likewise.
	* include/std/condition_variable: Likewise.
	* include/std/fstream: Likewise.
	* include/std/future: Likewise.
	* include/std/iostream: Likewise.
	* include/std/istream: Likewise.
	* include/std/mutex: Likewise.
	* include/std/numeric: Likewise.
	* include/std/ostream: Likewise.
	* include/std/ratio: Likewise.
	* include/std/shared_mutex: Likewise.
	* include/std/stdexcept: Likewise.
	* include/std/streambuf: Likewise.
	* include/std/system_error: Likewise.
	* include/std/thread: Likewise.
	* include/std/valarray: Likewise.
	* include/std/variant: Likewise.
	* include/tr1/cmath: Likewise.
	* include/tr1/regex: Likewise.
	* include/tr2/dynamic_bitset: Likewise.
	* libsupc++/atomic_lockfree_defines.h: Likewise.
	* libsupc++/exception: Likewise.
	* libsupc++/exception.h: Likewise.
	* libsupc++/exception_ptr.h: Likewise.
	* libsupc++/nested_exception.h: Likewise.

libstdc++-v3/ChangeLog:

	* include/tr1/regex:
2021-04-06 16:43:24 +01:00
Jakub Jelinek
99dee82307 Update copyright years. 2021-01-04 10:26:59 +01:00
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