[PATCH] D126694: [C++20][Modules] Implementation of GMF decl elision.

Iain Sandoe via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 29 02:58:58 PDT 2022

iains added inline comments.

Comment at: clang/include/clang/AST/DeclBase.h:624
   bool isModulePrivate() const {
     return getModuleOwnershipKind() == ModuleOwnershipKind::ModulePrivate;
ChuanqiXu wrote:
> According to the opinion from @rsmith, the discarded declaration is private too.
I guess you mean `>=`  ... however Discardable is a stronger constraint than Private 

If a decl remains marked Discardable (after the processing to determine reachable ones) that means it is both unreachable and invisible.
So it must not participate in any processing (with the one exception of diagnostic output).  I would be concerned that the change you suggest above could cause a  Discardable decl to be considered in merging  or lookup and we would then need (maybe a lot) of logic like:

 if (D->isModulePrivate() && !D->isModuleDiscardable())

I will take a look on the next iteration.

  rG LLVM Github Monorepo



More information about the cfe-commits mailing list