Hello, The little patch set of this thread addresses PRs c++/51239 and PRs c++/51180 in a generic way, as you suggested.
It replaces the BOUND_TEMPLATE_TEMPLATE_PARM tree with a TEMPLATE_ID_TYPE tree and makes bound template template parameters and typename types use that new tree. With this infrastructure in place, it was quite easy to represent unbound specializations of alias templates using the TEMPLATE_ID_TYPE tree. Thus, there are two patches in this set. The first, biggest one creates the TEMPLATE_ID_TYPE tree and makes typename types and bound template template parameters use it, and the second easily uses that to represent unbound specializations of alias templates to actually fix PRs c++/51239 and PRs c++/51180. Each patch has been bootstrapped and tested on x86_64-unknown-linux-gnu against trunk. -- Dodji