[llvm-branch-commits] [clang] release/22.x: [C++20] [Modules] Add VisiblePromoted module ownership kind (#189903) (PR #192885)
Chuanqi Xu via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed Apr 22 19:13:08 PDT 2026
================
@@ -1575,7 +1575,7 @@ void Sema::makeMergedDefinitionVisible(NamedDecl *ND) {
if (auto *ED = dyn_cast<EnumDecl>(ND);
ED && ED->isFromGlobalModule() && !ED->isScoped()) {
for (auto *ECD : ED->enumerators()) {
- ECD->setVisibleDespiteOwningModule();
+ ECD->setVisiblePromoted();
----------------
ChuanqiXu9 wrote:
> Hopefully that's a temporary measure though, right?
What do you mean? If you mean the version checking mechanism, I don't think it is temporary. It was there since the first day I came into it. If you mean the current patch, I feel the semantics is fine. Previously we have Visible and VisibleWhenImported, two kind of visible entities. But we don't have a visibility for the entities which was not visible but promoted (as described in the issue, that we have a visible redeclaration). So I feel it is natural to extend a new visibility here.
> But this still impacts PCH serialization behavior, doesn't it? Or is it not possible to mix PCH and modules together, so it really shouldn't cause any behavioral change?
I always forget PCh ... PCH follows the same logics as far as I know.
https://github.com/llvm/llvm-project/pull/192885
More information about the llvm-branch-commits
mailing list