Files
Egas Ribeiro a0908b6723 c++: Fix ICE with type aliases in inherited CTAD [PR122070]
When processing inherited CTAD in C++23, type_targs_deducible_from can
be called with a synthetic alias template whose TREE_VALUE is a type
alias.  Since TYPE_TEMPLATE_INFO_MAYBE_ALIAS can return NULL for type
aliases, we need to fall back to TYPE_TEMPLATE_INFO to get the template
info of the underlying type before calling TI_TEMPLATE, which should
always be non-NULL when called from inherited_ctad_tweaks.

	PR c++/122070

gcc/cp/ChangeLog:

	* pt.cc (type_targs_deducible_from): Fall back to
	TYPE_TEMPLATE_INFO when TYPE_TEMPLATE_INFO_MAYBE_ALIAS is NULL.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp23/class-deduction-inherited10.C: New test.
	* g++.dg/cpp23/class-deduction-inherited9.C: New test.

Signed-off-by: Egas Ribeiro <egas.g.ribeiro@gmail.com>
Co-authored-by: Patrick Palka <ppalka@redhat.com>
Reviewed-by: Patrick Palka <ppalka@redhat.com>
2025-12-18 09:24:34 -05:00
..
2025-05-02 09:36:58 -04:00