[PATCH] D129045: [C++20][Modules] Update handling of implicit inlines [P1779R3]

Chuanqi Xu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 4 02:15:31 PDT 2022


ChuanqiXu added a comment.

It looks like the tests lack the cast that the methods are attached to the global module fragment.



================
Comment at: clang/lib/Sema/SemaDecl.cpp:9363-9365
+        Module *M = NewFD->getOwningModule();
+        if (!M || M->isGlobalModule())
+          NewFD->setImplicitlyInline();
----------------
iains wrote:
> iains wrote:
> > ChuanqiXu wrote:
> > > nit: this is not  required.
> > well, the logic is required ;) .. you have suggested a different way to write..
> actually, I think you meant `!NewFD->getOwningModule() || NewFD->getOwningModule()->isGlobalModule()` but I've pulled the test out so that it's only done once.
> 
Yeah, thanks!


================
Comment at: clang/test/AST/ast-dump-constant-expr.cpp:94
+// CHECK-NEXT:`-CXXMethodDecl {{.*}} <line:56:3, col:38> col:18 consteval consteval_method 'void ()' implicit-inline
\ No newline at end of file

----------------
Maybe it is good to add the newline although it is not your fault.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D129045



More information about the cfe-commits mailing list