[clang] [clang] Substitute alias templates from correct context (PR #75069)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 11 11:13:35 PST 2023


================
@@ -3990,9 +3991,16 @@ QualType Sema::CheckTemplateIdType(TemplateName Name,
     if (Inst.isInvalid())
       return QualType();
 
-    CanonType = SubstType(Pattern->getUnderlyingType(),
-                          TemplateArgLists, AliasTemplate->getLocation(),
-                          AliasTemplate->getDeclName());
+    if (!RebuildingTypesInCurrentInstantiation) {
----------------
erichkeane wrote:

This is probably better/less likely to be screwed up in the future if we instead immediately do a 'SavedContext.pop()` if this condition is true, which leaves the SubstType code from being repeated/accidentially diverging.

https://github.com/llvm/llvm-project/pull/75069


More information about the cfe-commits mailing list