mirror of
https://forge.sourceware.org/marek/gcc.git
synced 2026-02-22 20:01:31 -05:00
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>