]>
git.ipfire.org Git - thirdparty/gcc.git/commit
c++: build contract_violation object directly
The __on_contract_violation function was an awkward library dependency;
instead, let's build up a temporary contract_violation and call
handle_contract_violation directly.
gcc/cp/ChangeLog:
* cp-tree.h (enum cp_tree_index): Remove
CPTI_ON_CONTRACT_VIOLATION*, add CPTI_PSEUDO_CONTRACT_VIOLATION.
(pseudo_contract_violation_type): New.
(on_contract_violation_fn)
(on_contract_violation_never_fn): Remove.
* contracts.cc (get_pseudo_contract_violation_type): New.
(build_contract_violation): New.
(declare_handle_contract_violation): New.
(build_contract_handler_call): Use them.
(build_contract_check): Call terminate here.
(init_contract_processing): Remove.
* decl.cc (cxx_init_decl_processing): Don't call it.
libstdc++-v3/ChangeLog:
* src/experimental/contract.cc (__on_contract_violation): Remove.
* include/experimental/contract: Remove its comment.
gcc/testsuite/ChangeLog:
* g++.dg/contracts/contracts14.C
* g++.dg/contracts/contracts15.C: Remove __on_contract_violation.