https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99425
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Nathan Sidwell <nat...@gcc.gnu.org>: https://gcc.gnu.org/g:87e3c2ef682e2ba7692ee56142a4eb5b6441c4d3 commit r11-7765-g87e3c2ef682e2ba7692ee56142a4eb5b6441c4d3 Author: Nathan Sidwell <nat...@acm.org> Date: Thu Mar 18 05:12:59 2021 -0700 c++: duplicate alias templates with decltype [PR 99425] This failure was ultimately from incorrect handling of alias templates, but required a specific set of occurrences to happen in the specialization hash table. This cleans up the specialization streaming to add alias instantiations at the same point as other instantiations. I also removed some unneeded global variables dealing with mapping of duplicate decl contexts. PR c++/99425 gcc/cp/ * cp-tree.h (map_context_from, map_context_to): Delete. (add_mergeable_specialization): Add is_alias parm. * pt.c (add_mergeable_specialization): Add is_alias parm, add them. * module.cc (map_context_from, map_context_to): Delete. (trees_in::decl_value): Add specializations later, adjust call. Drop useless alias lookup. Set duplicate fn parm context. (check_mergeable_decl): Drop context mapping. (trees_in::is_matching_decl): Likewise. (trees_in::read_function_def): Drop parameter context adjustment here. gcc/testsuite/ * g++.dg/modules/pr99425-1.h: New. * g++.dg/modules/pr99425-1_a.H: New. * g++.dg/modules/pr99425-1_b.H: New. * g++.dg/modules/pr99425-1_c.C: New. * g++.dg/modules/pr99425-2_a.X: New. * g++.dg/modules/pr99425-2_b.X: New. * g++.dg/template/pr99425.C: New.