Skip to content
Snippets Groups Projects
Commit d3627c78 authored by Nathaniel Shead's avatar Nathaniel Shead
Browse files

c++: Improve contracts support in modules [PR108205]


Modules makes some assumptions about types that currently aren't
fulfilled by the types created in contracts logic.  This patch ensures
that exporting inline functions using contracts works again with
modules.

	PR c++/108205

gcc/cp/ChangeLog:

	* contracts.cc (get_pseudo_contract_violation_type): Give names
	to generated FIELD_DECLs.
	(declare_handle_contract_violation): Mark contract_violation
	type as external linkage.
	(build_contract_handler_call): Ensure any builtin declarations
	created here aren't treated as attached to the current module.

gcc/testsuite/ChangeLog:

	* g++.dg/modules/contracts-5_a.C: New test.
	* g++.dg/modules/contracts-5_b.C: New test.

Signed-off-by: default avatarNathaniel Shead <nathanieloshead@gmail.com>
parent 736e8eef
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment