// applied to ObjC builtin attributes.
if (isa<AttributedType>(type) && attr.hasMacroIdentifier() &&
!type.getQualifiers().hasObjCLifetime() &&
- !type.getQualifiers().hasObjCGCAttr()) {
+ !type.getQualifiers().hasObjCGCAttr() &&
+ attr.getKind() != ParsedAttr::AT_ObjCGC &&
+ attr.getKind() != ParsedAttr::AT_ObjCOwnership) {
const IdentifierInfo *MacroII = attr.getMacroIdentifier();
type = state.getSema().Context.getMacroQualifiedType(type, MacroII);
state.setExpansionLocForMacroQualifiedType(
void test_cast_qualifier_inference(__weak id *value) {
__weak id *a = (id*) value;
- __unsafe_unretained id *b = (id *)value; // expected-error {{initializing '__unsafe_unretained id *' with an expression of type '__weak id *' changes retain/release properties of pointer}}
+ __unsafe_unretained id *b = (id *)value; // expected-error {{initializing 'id *' with an expression of type '__weak id *' changes retain/release properties of pointer}}
}