llvm-project
ced50aaf - Allow ObjC writeback conversion in cleanup attribute type check (#195318)

Commit
25 days ago
Allow ObjC writeback conversion in cleanup attribute type check (#195318) Prior to #164440, CheckAssignmentConstraints in the cleanup attribute handler ran before ObjC lifetime qualifiers were inferred on the variable. It compared against a type without '__strong' and accepted both 'T **' to 'T *__autoreleasing *' and 'T **' to 'T *__unsafe_unretained *'. #164440 reversed the order, so the check now runs after '__strong' is inferred and rejects both 'T *__strong *' to 'T *__autoreleasing *' and 'T *__strong *' to 'T *__unsafe_unretained *'. Fix the valid case by falling back to isObjCWritebackConversion when the assignment check fails. This re-allows the '__strong' to '__autoreleasing' writeback conversion while continuing to reject '__strong' to '__unsafe_unretained'. rdar://175133715
Author
Parents
Loading