[ObjC] Boxed strings should use the nullability from stringWithUTF8String's…

Authored by arphaman on Nov 8 2017, 1:33 PM.


[ObjC] Boxed strings should use the nullability from stringWithUTF8String's return type

Objective-C NSString has a class method stringWithUTF8String that creates a new
NSString from a C string. Objective-C box expression @(...) can be used to
create an NSString instead of invoking the stringWithUTF8String method directly
(The compiler lowers it down to the invocation though). This commit ensures that
the type of @(string-value) gets the same nullability attributes as the return
type of stringWithUTF8String to ensure that the diagnostics are consistent
between the two.


Differential Revision: https://reviews.llvm.org/D39762

llvm-svn: 317727