This is an archive of the discontinued LLVM Phabricator instance.

[SemaObjC] Add a warning for declarations of BOOL:1 when BOOL is a signed char
Needs ReviewPublic

Authored by erik.pilkington on Mar 30 2020, 9:21 AM.

Details

Summary

Instead, recommend using a real boolean type. Its possible to get away with BOOL:1, if you only read from it in a context where its contextually converted to bool, but its still broken if you, for instance, store it into a BOOL variable or try to compare it with another BOOL. Given that, I don't think there is any good reason to use it when there are better alternatives available.

rdar://29707989

Diff Detail

Event Timeline

This feels like it's going to bite a lot of people, but maybe it's the best option.