gnu /
gcc /
493164dddd8fca98365cbd768e2b057a8263a48d c++: contract condition function linkage
Since the .pre/post functions are implementation details, not ABI artifacts,
we should make them internal when possible, including putting them in the
same COMDAT group with a vague linkage guarded function.
gcc/cp/ChangeLog:
* contracts.cc (build_contract_condition_function): Set linkage.
* semantics.c (expand_or_defer_fn_1): Call finish_function_contracts
here.
* decl.c (finish_function): Not here.
* decl2.c (comdat_linkage): Add pre/post fns to same comdat group.
gcc/testsuite/ChangeLog:
* g++.dg/contracts/contracts-comdat1.C: New test.
3 files changed