]> gcc.gnu.org Git - gcc.git/commit
c++: alias_ctad_tweaks and constrained dguide [PR95486]
authorPatrick Palka <ppalka@redhat.com>
Thu, 30 Jul 2020 02:06:41 +0000 (22:06 -0400)
committerPatrick Palka <ppalka@redhat.com>
Wed, 21 Apr 2021 12:41:25 +0000 (08:41 -0400)
commit4806f9157a26cfd66c083bcc01596ff33009c0d6
tree5dcafd8b9802bd0f82162523c5d8dcdc5e66b337
parent525c2634c1f945072eaa14b6d264b1904b6f81ea
c++: alias_ctad_tweaks and constrained dguide [PR95486]

In the below testcase, we're ICEing from alias_ctad_tweaks ultimately
because the implied deduction guide for X's user-defined constructor
already has constraints associated with it.  We then carry over these
constraints to 'fprime', the overlying deduction guide for the alias
template Y, via tsubst_decl from alias_ctad_tweaks.  Later in
alias_ctad_tweaks we call get_constraints followed by set_constraints
without doing remove_constraints in between, which triggers the !found
assert in set_constraints.

This patch fixes this issue by adding an intervening call to
remove_constraints.

gcc/cp/ChangeLog:

PR c++/95486
* pt.c (alias_ctad_tweaks): Call remove_constraints before
calling set_constraints.

gcc/testsuite/ChangeLog:

PR c++/95486
* g++.dg/cpp2a/class-deduction-alias3.C: New test.

(cherry picked from commit 71141b1bd537cc516e485c834c2d36abba3f4544)
gcc/cp/pt.c
gcc/testsuite/g++.dg/cpp2a/class-deduction-alias3.C [new file with mode: 0644]
This page took 0.065516 seconds and 6 git commands to generate.