This is an archive of the discontinued LLVM Phabricator instance.

format_arg attribute does not support nullable instancetype return type
ClosedPublic

Authored by fcloutier on Nov 10 2021, 6:10 PM.

Details

Summary

Following up with D112670, it appears that the original fix was insufficient: it's not possible to use __attribute__((format_arg)) on methods that return instancetype in NSString when instancetype is sugared, as this breaks pointer equality. Although this is only possible in limited scenarios because instancetype is a contextual keyword, it can (crucially) be combined with nullability qualifiers.

rdar://85278860

Diff Detail

Event Timeline

fcloutier created this revision.Nov 10 2021, 6:10 PM
fcloutier requested review of this revision.Nov 10 2021, 6:10 PM
This revision is now accepted and ready to land.Nov 12 2021, 11:54 AM