[clang] [lldb] [C++20][Modules] Do not update the declaration generation number if the redeclaration chain completion was delayed. (PR #129982)
Michael Park via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 7 01:07:19 PST 2025
================
@@ -9180,6 +9180,12 @@ bool Sema::hasAcceptableDefinition(NamedDecl *D, NamedDecl **Suggested,
if (!getLangOpts().Modules && !getLangOpts().ModulesLocalVisibility)
return true;
+ // The external source may have additional definitions of this entity that are
+ // visible, so complete the redeclaration chain now.
+ if (auto *Source = Context.getExternalSource()) {
+ Source->CompleteRedeclChain(D);
+ }
----------------
mpark wrote:
On one thought, it seems like the decls inside `DC` should be notified of the fact that there have been new additions made to `Lookups[DC]`... but on the other hand, it's not clear to me whether this is an expected sequence of events in the first place. If this is an expected sequence of events, I'm a bit surprised that this doesn't seem to be a bigger issue. If this is not an expected sequence of events, do we expect that the first call to `CompleteRedeclChain` should have the `Lookups` populated with everything already?
CC @ChuanqiXu9, maybe @Bigcheese can help here too?
https://github.com/llvm/llvm-project/pull/129982
More information about the cfe-commits
mailing list