================
@@ -16681,7 +16677,8 @@ Decl *Sema::ActOnFinishFunctionBody(Decl *dcl, Stmt 
*Body,
   if (!IsInstantiation)
     PopDeclContext();
 
-  PopFunctionScopeInfo(ActivePolicy, dcl);
+  if (!RetainFunctionScopeInfo)
+    PopFunctionScopeInfo(ActivePolicy, dcl);
----------------
zyn0217 wrote:

> Do we have some sort of assert to make sure we don't ever end up with 
> unpopped scopes at the end of a TU?

No afaik, but at least we're correctly pairing Pop and Push for lambdas - we 
call BuildLambdaExpr immediately after FinishFunctionBody. So the behavior 
should remain the same as before.

> Also, we probably need to document the new bool in a way that makes it clear 
> that you MUST be responsible for popping your own function scope if you pass 
> 'true'.

Done

https://github.com/llvm/llvm-project/pull/154106
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to