[PATCH] D55865: [ObjC] Add a new attribute to opt-out of implicit callee retain/release in ARC
Erik Pilkington via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Dec 20 16:19:18 PST 2018
erik.pilkington added inline comments.
================
Comment at: clang/test/SemaObjC/externally-retained.m:14
+
+ EXT_RET int (^d)() = ^{return 0;};
+ EXT_RET ObjCTy *e = 0;
----------------
aaron.ballman wrote:
> Should this be useful for function pointer parameters as well? e.g.,
> ```
> typedef void (*fp)(EXT_RET __strong ObjCTy *);
>
> void f(__strong ObjCTy *);
>
> void g(EXT_RET ObjCTy *Ptr) {
> fp Fn = f; // Good idea? Bad idea?
> Fn(Ptr); // Which behavior "wins" in this call?
> }
> ```
The attribute doesn't have any effect on the caller side, so when used with a function pointer type the attribute doesn't really do anything (the function definition always "wins").
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55865/new/
https://reviews.llvm.org/D55865
More information about the cfe-commits
mailing list