[cfe-users] objc. __auto_type and nullablility inheritance.

Alfred Zien via cfe-users cfe-users at lists.llvm.org
Mon Dec 12 05:26:42 PST 2016

Hi to everyone! I'm integrating __auto_type to project, and I faced with some weird issue. 

__auto_type doesn't inherit nullability nor ownership qualifiers, so if I write

__weak Type* _Nonnull a = f();
__auto_type b = a;

b will be just Type*, with strong ownership and __nullability_unspecified specifier.

Although, if I'm writing

__weak Type* _Nonnull a = f();
__typeof(a) b = a;

Everything inherits as expected. So type of b is __weak Type* _Nonnull.
I know, __weak and _Nullable doesn't make any sense for one variable declaration, but I think you get the point.

Is it ok? Why such decision has been made?
Thanks for any clarification.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-users/attachments/20161212/a9fac4b8/attachment.html>

More information about the cfe-users mailing list