This attribute can be applied to typedefs of BOOL in Objective-C. It causes loads, stores, and casts to BOOL to clamp into {0,1}. This is useful for us because a lot of code is going to be moving from a platform where BOOL is a typedef for a native bool type (iOS) to a platform where its a typedef for signed char (macOS) because of macCatalyst. We can't change the type of the BOOL, since its ABI.
rdar://6510042
Thanks for taking a look!
Erik
Is there a desire for similar functionality for C's _Bool datatype, or other, custom datatypes (perhaps BOOL from the Win32 APIs)? It seems like this attribute could be generalized to apply to any typedef to an integral type.