When determining if a constraint is satisfied, the function satisfy_argument_deduction_constraint temporarily changes the PLACEHOLDER_TYPE_CONSTRAINTS of an tree node. Since PLACEHOLDER_TYPE_CONSTRAINTS are taken into account when determining the equality of two types, this means that the node's canonical type must also change; otherwise, an ICE results if the type is compared to another type that it was previously equal to.
The attached patch sets the node's TYPE_CANONICAL field to NULL_TREE after the PLACEHOLDER_TYPE_CONSTRAINTS are changed and restores TYPE_CANONICAL to its original value when the PLACEHOLDER_TYPE_CONSTRAINTS value are changed back so that erroneous canonical type comparisons aren't made. Bootstrapped and regression tested on x86_64-linux 2015-12-03 Ryan Burn <cont...@rnburn.com> PR c++/68683 * constraint.cc (satisfy_argument_deduction_constraint): Set TYPE_CANONICAL to NULL_TREE if PLACEHOLDER_TYPE_CONSTRAINTS are changed. * g++.dg/concepts/pr68683.C: New test
pr68683.patch
Description: Binary data