From: Leonard Chan Date: Wed, 8 May 2019 05:59:25 +0000 (+0000) Subject: Fix for the greendragon bots. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3767637144e012be48d29e094b4ea2962e8f8bce;p=clang Fix for the greendragon bots. Adds extra checks for ObjC GC and Ownership. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@360225 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp index 17dbba921c..4c7c13e9e2 100644 --- a/lib/Sema/SemaType.cpp +++ b/lib/Sema/SemaType.cpp @@ -7612,7 +7612,9 @@ static void processTypeAttrs(TypeProcessingState &state, QualType &type, // applied to ObjC builtin attributes. if (isa(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( diff --git a/test/SemaObjC/mrc-weak.m b/test/SemaObjC/mrc-weak.m index af7081b53f..e5f407c9d8 100644 --- a/test/SemaObjC/mrc-weak.m +++ b/test/SemaObjC/mrc-weak.m @@ -62,6 +62,6 @@ void test_unsafe_unretained_cast(id *value) { 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}} }