Index: lib/Sema/SemaTemplate.cpp =================================================================== --- lib/Sema/SemaTemplate.cpp +++ lib/Sema/SemaTemplate.cpp @@ -2292,15 +2292,7 @@ // A have identical types when A is declared as: // // template struct A; - TemplateName CanonName = Context.getCanonicalTemplateName(Name); - CanonType = Context.getTemplateSpecializationType(CanonName, - Converted); - - // FIXME: CanonType is not actually the canonical type, and unfortunately - // it is a TemplateSpecializationType that we will never use again. - // In the future, we need to teach getTemplateSpecializationType to only - // build the canonical type and return that to us. - CanonType = Context.getCanonicalType(CanonType); + CanonType = Context.getCanonicalTemplateSpecializationType(Name, Converted); // This might work out to be a current instantiation, in which // case the canonical type needs to be the InjectedClassNameType. @@ -3353,7 +3345,7 @@ SourceLocation TemplateLoc, SourceLocation RAngleLoc, TemplateTypeParmDecl *Param, - SmallVectorImpl &Converted) { + SmallVectorImpl &Converted) { TypeSourceInfo *ArgType = Param->getDefaultArgumentInfo(); // If the argument type is dependent, instantiate it now based