[PATCH] D110215: [C++2a] [Module] Support extern C/C++ semantics
Chuanqi Xu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Oct 8 19:51:49 PDT 2021
ChuanqiXu added inline comments.
================
Comment at: clang/lib/Sema/SemaDecl.cpp:9351
+ (NewFD->isExternCContext() || NewFD->isExternCXXContext())) {
+ if (!getGlobalModule())
+ Diag(NewFD->getLocation(),
----------------
aaron.ballman wrote:
> I'm a bit confused here. [module.unit]p7 is describing what module a declaration attached to under which circumstances. I don't see a constraint there which should result in a diagnostic. My reading of https://eel.is/c++draft/module.unit#6 is that the global module always exists, so we should be able to attach declarations to it at any point. Am I misunderstanding?
Yeah, after looking into this, I think you are right. We should create the global module when we need it but failed to find it.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D110215/new/
https://reviews.llvm.org/D110215
More information about the cfe-commits
mailing list