================
@@ -1976,14 +1976,16 @@ 
TemplateDeclInstantiator::VisitFunctionTemplateDecl(FunctionTemplateDecl *D) {
   if (!InstParams)
     return nullptr;
 
+  // Use canonical templated decl because only canonical decl has body
+  // if declarations were merged during loading from modules.
+  FunctionDecl *TemplatedDecl = D->getTemplatedDecl()->getCanonicalDecl();
----------------
ilya-biryukov wrote:

There's a use of `D->getTemplatedDecl()` below, on line 2006 in 
`D->getTemplatedDecl()->isThisDeclarationADefinition->isThisDeclarationADefinition()`.

I am wondering if we should update the use there too?
I suspect that even if it doesn't matter, we're better off using 
`TemplatedDecl` there too (it's more "obviously" correct)

https://github.com/llvm/llvm-project/pull/111992
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to