This is an archive of the discontinued LLVM Phabricator instance.

[Sema][ObjC] Allow conversions between pointers to ObjC pointers and pointers to structs
ClosedPublic

Authored by ahatanak on Jul 28 2021, 7:11 PM.

Details

Summary

clang was just being conservative and trying to prevent users from messing up the qualifier on the inner pointer type. Lifting this restriction enables using some of the libc++ templates with ObjC pointer arguments, which clang currently rejects.

rdar://79018677

Diff Detail

Event Timeline

ahatanak requested review of this revision.Jul 28 2021, 7:11 PM
ahatanak created this revision.

I don't think there is any reason conversions between ACTC_none and ACTC_indirectRetainable (for example, conversions between struct S ** and __strong id *x or int * and __strong id *x) should be disallowed. I just made the minimal change needed to enable using ObjC ARC pointers as the libc++ functions' template arguments.

ahatanak updated this revision to Diff 368391.Aug 24 2021, 10:32 AM

Rebase and ping.

rjmccall accepted this revision.Aug 24 2021, 8:58 PM

Alright, LGTM.

This revision is now accepted and ready to land.Aug 24 2021, 8:58 PM