]> gcc.gnu.org Git - gcc.git/commit
c++: bad ggc_free in try_class_unification [PR109556]
authorPatrick Palka <ppalka@redhat.com>
Wed, 19 Apr 2023 17:07:46 +0000 (13:07 -0400)
committerPatrick Palka <ppalka@redhat.com>
Wed, 19 Apr 2023 17:07:46 +0000 (13:07 -0400)
commit5e284ebbc3082c5a8974d24e3a0977aa48f3cc60
treeb5bd4f7613203bcf18394c160b655c6850736145
parent6fc8e25cb6b5d720bedd85194b0ad740d75082f4
c++: bad ggc_free in try_class_unification [PR109556]

Aside from correcting how try_class_unification copies multi-dimensional
'targs', r13-377-g3e948d645bc908 also made it ggc_free this copy as an
optimization.  But this is wrong since the call to unify within might've
captured the args in persistent memory such as the satisfaction cache
(as part of constrained auto deduction).

PR c++/109556

gcc/cp/ChangeLog:

* pt.cc (try_class_unification): Don't ggc_free the copy of
'targs'.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/concepts-placeholder13.C: New test.
gcc/cp/pt.cc
gcc/testsuite/g++.dg/cpp2a/concepts-placeholder13.C [new file with mode: 0644]
This page took 0.059284 seconds and 5 git commands to generate.