This patch fixes an assert that fires when there is a property that has attribute nonatomic and type _Atomic(_Bool). The assert fires when an i1 value is bitcast to i8 (which is the type ConvertType(propType) returns).
I have a couple of questions as I wasn't sure this was the right way to fix the assert.
- Is it legal to have attribute nonatomic on a property that has an atomic type? Should clang error out?
- Should the return type of the getter method be i1 or i8? I chose not to change the return type (which was i8), but I think there are cases where changing it to i1 might make more sense. For example, the following code currently doesn't compile because foo1 and the getter for "p" (which is the property of A in the test case) have different return types.
_Bool foo1() { A *a = [A new]; return i.p; }
rdar://problem/26322972
Please name this getAtomicUnqualifiedType() and have it promise to remove all qualifiers including _Atomic. It should not promise to remove type sugar.