parallaxe added a comment.

In https://reviews.llvm.org/D23236#557898, @dcoughlin wrote:

> Upon reflection, I don't think this is the right approach.
>
> Desugaring any AttributedType in the return type seems like a really, really 
> big hammer and could be an unexpected surprise for future attributed types 
> where this is not the right behavior. I think a better approach for the 
> nullability issue would be to update `lookThroughImplicitCasts()` in 
> NullabilityChecker.cpp to look though `ExprWithCleanups` expressions just 
> like it currently does for implicit casts.
>
> What do you think?


As far as I understand the code, I would leave my change as it is.
The part of the code I have changed tries to guess the return-type for the 
expression inside the return-stmt. At this point, no type could be computed (as 
RelatedRetType.isNull() is true). Assuming that any annotation that the 
return-type of the function has, will also apply to the return-type of the 
expression, might be misleading. The improvements of the warnings in 
nullability.m are a good sign of this (which would be lost when I would just 
make a change in the NullabilityChecker).

Does that sound sensible?


https://reviews.llvm.org/D23236



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to