[Sema][ObjC] Do not propagate the nullability specifier on the receiver
authorAkira Hatanaka <ahatanaka@apple.com>
Thu, 26 Jul 2018 17:51:13 +0000 (17:51 +0000)
committerAkira Hatanaka <ahatanaka@apple.com>
Thu, 26 Jul 2018 17:51:13 +0000 (17:51 +0000)
commit66d405d31f5cb778902315fbefd6421fa85aa6d1
tree7eb985144e2f403899d70302d3dc96ad5b1e8252
parent2e4106b73da2bd2845f9676e79ea43d4d3540813
[Sema][ObjC] Do not propagate the nullability specifier on the receiver
to the result type of a message send if the result type cannot have a
nullability specifier.

Previously, clang would print the following message when the code in
nullability.m was compiled:

"incompatible integer to pointer conversion initializing 'int *' with
an expression of type 'int _Nullable'"

This is wrong as 'int' isn't supposed to have any nullability
specifiers.

rdar://problem/40830514

llvm-svn: 338048
clang/lib/Sema/SemaExprObjC.cpp
clang/test/SemaObjC/nullability.m