https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118626
--- Comment #12 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Patrick Palka <ppa...@gcc.gnu.org>: https://gcc.gnu.org/g:7a91400c142899ea0aeb8b62577496cf24c68156 commit r15-9231-g7a91400c142899ea0aeb8b62577496cf24c68156 Author: Patrick Palka <ppa...@redhat.com> Date: Sat Apr 5 22:39:15 2025 -0400 c++: maybe_dependent_member_ref and typenames [PR118626] Here during maybe_dependent_member_ref for accepted_type<_Up>, we correctly don't strip the typedef because it's a complex one (its defaulted template parameter isn't used in its definition) and so we recurse to consider its corresponding TYPE_DECL. We then incorrectly decide to not rewrite this use because of the TYPENAME_TYPE shortcut. But I don't think this shortcut should apply to a typedef TYPE_DECL. PR c++/118626 gcc/cp/ChangeLog: * pt.cc (maybe_dependent_member_ref): Restrict TYPENAME_TYPE shortcut to non-typedef TYPE_DECL. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/class-deduction-alias25a.C: New test. Reviewed-by: Jason Merrill <ja...@redhat.com>