]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: alias CTAD and specializations table
authorPatrick Palka <ppalka@redhat.com>
Mon, 11 Dec 2023 14:48:04 +0000 (09:48 -0500)
committerPatrick Palka <ppalka@redhat.com>
Mon, 11 Dec 2023 14:48:04 +0000 (09:48 -0500)
commitf5aa23f7f633313039c840ab36695a38efbb1a99
treea688c732ca58015f983370d838430b808ac2c94f
parentb1474da1bb9cc829cbf597f9a51393795108419f
c++: alias CTAD and specializations table

A rewritten guide for alias CTAD isn't really a specialization of the
original guide, so we shouldn't register it as such.  This avoids an ICE
in the below modules testcase for which we otherwise crash due to the
guide's empty DECL_CONTEXT when walking the specializations table.  It
also preemptively avoids the same ICE in modules/concept-6 in C++23 mode
with the inherited CTAD patch.

gcc/cp/ChangeLog:

* pt.cc (alias_ctad_tweaks): Pass use_spec_table=false to
tsubst_decl.

gcc/testsuite/ChangeLog:

* g++.dg/modules/concept-8.h: New test.
* g++.dg/modules/concept-8_a.H: New test.
* g++.dg/modules/concept-8_b.C: New test.
gcc/cp/pt.cc
gcc/testsuite/g++.dg/modules/concept-8.h [new file with mode: 0644]
gcc/testsuite/g++.dg/modules/concept-8_a.H [new file with mode: 0644]
gcc/testsuite/g++.dg/modules/concept-8_b.C [new file with mode: 0644]