================
@@ -231,6 +249,9 @@ void IncrementalParser::CleanUpPTU(TranslationUnitDecl 
*MostRecentTU) {
         !D->getLangOpts().CPlusPlus)
       S.IdResolver.RemoveDecl(ND);
   }
+
+  // Lookup alone is not enough: the redeclaration chain still reaches these.
+  withdrawMostRecentTU(MostRecentTU);
----------------
conrade-ctc wrote:

Actually, I think this can't work because we're relying on the friend decl to 
access write protected/private members (`RedecLink` and `TUDecl`... we could do 
the static helper function as you suggest with some extra friend decls in the 
AST headers. If we don't do that, we could make this a static member with the 
context arg to avoid future touching of state other than via the passed in 
arg... want me to push that update?

https://github.com/llvm/llvm-project/pull/213235
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to