================ @@ -4159,7 +4159,7 @@ FunctionTemplateDecl *FunctionDecl::getPrimaryTemplate() const { if (FunctionTemplateSpecializationInfo *Info = TemplateOrSpecialization .dyn_cast<FunctionTemplateSpecializationInfo*>()) { - return Info->getTemplate(); + return Info->getTemplate()->getMostRecentDecl(); ---------------- mizvekov wrote:
Why do we need to get the most recent declaration in all these places? I worry this will cause us problems in the future, where for example in friend declarations, the exact redeclaration can be significant. Won't this also degrade source representation accuracy? https://github.com/llvm/llvm-project/pull/111173 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits