This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[C++ PATCH] fix canonical type node ICE when from satisfy_argument_deduction_constraint function (PR c++/68683)


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  <contact@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

Attachment: pr68683.patch
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]