Yes, you are correct: clang implicitly marks indirect parameters with
__autoreleasing.
The whole purpose of Wblock-capture-autoreleasing (which was committed in
r285031) is to inform the users that clang has implicitly marked an
out-parameter as __autoreleasing. clang doesn’t warn if the user e
If I'm understanding you correctly, you're saying that clang implicitly
marks the indirect NSError** parameter with __autoreleasing, so there's no
bug here. Is that correct? If so, should Wblock-capture-autoreleasing just
not fire on parameters that are already implicitly marked as
__autoreleasing?
Hi Nico,
The documentation might confuse people now that the warning is on by default,
but it’s correct as clang still qualifies indirect parameters with
__autoreleasing. We had to add this warning and turn it on by default because a
lot of people capture indirect parameters in their code not r
Hi Akira,
this fires in internal chrome/ios code like so:
somefile.m: error: block captures an autoreleasing out-parameter, which may
result in use-after-free bugs [-Werror,-Wblock-capture-autoreleasing]
if (error) {
^
somefile.m: note: declare the parameter __autoreleasin