When applied to out-parameters, the attributes specify the expected lifetime of the written-into object.
Additionally, introduce OSReturnsRetainedOn(Non)Zero attributes, which specify that an ownership transfer happens depending on a return code.
Differential D56292
[attributes] Extend os_returns_(not_?)_retained attributes to parameters. george.karpenkov on Jan 3 2019, 2:43 PM. Authored by
Details When applied to out-parameters, the attributes specify the expected lifetime of the written-into object. Additionally, introduce OSReturnsRetainedOn(Non)Zero attributes, which specify that an ownership transfer happens depending on a return code.
Diff Detail Event Timeline
Comment Actions Addressed comments, added conditional out parameters.
Comment Actions @aaron.ballman I'm half-tempted to rewrite most of attribute handling to just have a single attribute class with multiple spelling, and then I would be able to differentiate between them without meta-programming template trickery. What do you think? Comment Actions OTOH using a single attribute class for all attributes makes usage from Sema very unwieldy, Comment Actions LGTM aside from some minor nits.
|
The documentation should be updated to mention this change.