ChuanqiXu added inline comments.

================
Comment at: clang/lib/Sema/SemaDecl.cpp:15258
+  // units.  Deleted and Defaulted functions are implicitly inline (but the
+  // inline state is not set at this point, so check the BodyKind explicitly).
   if (getLangOpts().CPlusPlusModules && currentModuleIsHeaderUnit() &&
----------------
I prefer to add a FIXME here to say that we need to find a better place for the 
check to eliminate the unnecessary check for `BodyKind `. The current check for 
`BodyKind` looks a little bit hacky to me.


================
Comment at: clang/lib/Sema/SemaDecl.cpp:15261
+      FD->getFormalLinkage() == Linkage::ExternalLinkage &&
+      !FD->isInvalidDecl() && BodyKind == FnBodyKind::Other &&
+      !FD->isInlined()) {
----------------
It looks like we need to check `FD->isThisDeclarationADefinition()` too.

And personally, I prefer to check BodyKind explicitly. Otherwise the readers 
need to checkout the definition of `FnBodyKind` to understand the code. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141908

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

Reply via email to