aaron.ballman added inline comments.
================
Comment at: clang/test/SemaObjC/externally-retained.m:14
+
+ EXT_RET int (^d)() = ^{return 0;};
+ EXT_RET ObjCTy *e = 0;
----------------
erik.pilkington wrote:
> 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").
Perhaps we should warn (and drop the attribute) if you try to write it on a
parameter in a function pointer type rather than a function declaration? That
way users won't think code like the above does anything useful. Alternatively,
we could warn if there was a mismatch between markings (so the attribute is
still a noop with function pointer types, but the consistent markings make that
benign).
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55865/new/
https://reviews.llvm.org/D55865
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits