https://github.com/sam-mccall commented:

Thanks for working on this! I'm far from an expert on the LLVM side so we'll 
need someone to weigh in.


We need to specify specify the behavior somewhere. I think we should add a 
description to `docs/LanguageExtensions.html`, which describes various other 
`__builtin_*`.

I'm not sure defining this in terms of "like start_lifetime_as but..." is ideal 
because:

 - implicit object creation recurses into only implicit-lifetimes subobjects, 
where this will recurse into everything. (Whether this is the same or different 
depends on your persepctive.
 - Unlike start_lifetime_as, it's clearly more useful to say "this starts an 
object's lifetime" than "this may start an object's lifetime as needed to avoid 
UB", I think this clarifies when you can/must call destructors. In this sense 
it's more like placement-new than start-lifetime-as.

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

Reply via email to