================
@@ -268,11 +268,12 @@ class ASTDeclUnmerger : public
DeclVisitor<ASTDeclUnmerger> {
removeFromLookups(ND);
}
- // Restore lookup for the surviving predecessor
- // of any removed decl that had a surviving predecessor
- DeclContext *Primary = DC->getPrimaryContext();
+ // Restore lookup for the surviving predecessor of any removed decl that
+ // had a surviving predecessor. Like removeDecl(), use its semantic
+ // context: the out-of-line definition of a member is in DC, but it was
+ // removed from the lookup table of its class or namespace.
for (NamedDecl *Prev : Survivors)
- Primary->makeDeclVisibleInContext(Prev);
+ Prev->getDeclContext()->makeDeclVisibleInContext(Prev);
----------------
vgvassilev wrote:
This logic should go in `VisitNamedDecl`.
https://github.com/llvm/llvm-project/pull/229780
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits