ChuanqiXu added inline comments.

================
Comment at: clang/lib/Sema/SemaDecl.cpp:15265
       FD->getFormalLinkage() == Linkage::ExternalLinkage &&
-      !FD->isInvalidDecl() && BodyKind != FnBodyKind::Delete &&
+      !FD->isInvalidDecl() && !IsFnTemplate && BodyKind != FnBodyKind::Delete 
&&
       BodyKind != FnBodyKind::Default && !FD->isInlined()) {
----------------
iains wrote:
> rsmith wrote:
> > Would it make sense to use `!isa<FunctionTemplateDecl>(D)` here instead of 
> > adding `IsFnTemplate`?
> > Would it make sense to use `!isa<FunctionTemplateDecl>(D)` here instead of 
> > adding `IsFnTemplate`?
> 
> I have changed this to use FD->isTemplated() to match the changes for 
> VarDecls - where the template decl is not available.  Would it be better to 
> use the isa<>() ?
> 
It looks not bad to me to use `isTemplated ()`. And it looks like 
`!FD->isTemplateInstantiation()` is not tested? And it looks a little bit odd 
since the instantiated template should be implicitly inline.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142704/new/

https://reviews.llvm.org/D142704

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to