Skip to content
Snippets Groups Projects
Commit ae57e527 authored by Nina Dinka Ranns's avatar Nina Dinka Ranns Committed by Jason Merrill
Browse files

c++/contracts: ICE in build_contract_condition_function [PR116490]


We currently do not expect comdat group of the guarded function to
be set at the time of generating pre and post check function.
However, in the case of an explicit instantiation, the guarded
function has been added to a comdat group before generating contract
check functions, which causes the observed ICE. Current assert
removed and an additional check for comdat group of the guarded
function added. With this change, the pre and post check functions
get added to the same comdat group of the guarded function if the
guarded function is already placed in a comdat group.

	PR c++/116490

gcc/cp/ChangeLog:

	* contracts.cc (build_contract_condition_function): added
	a check for comdat group of the guarded function. If set,
	the condition check function is added to the same comdat
	group.

gcc/testsuite/ChangeLog:

	* g++.dg/contracts/pr116490.C: New test.

Signed-off-by: default avatarNina Ranns <dinka.ranns@gmail.com>
parent 4cb20dc0
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