efriedma-quic wrote:

The patch looks mechanically correct: if we want to allow defining automatic 
duration blocks inside a static initializer, we need a boolean like you've 
outlined.

You should be able to check for the presence of a block by looking at the 
cleanups in the ExprWithCleanups.

-----

Having said that, these semantics are not helpful to users.  If we can't reach 
an agreement on changing the lifetime extension rules here, I'd rather just 
reject the construct (with an error in Sema).

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

Reply via email to