diff options
author | Leonard Chan <leonardchan@google.com> | 2019-05-08 05:59:25 +0000 |
---|---|---|
committer | Leonard Chan <leonardchan@google.com> | 2019-05-08 05:59:25 +0000 |
commit | aae9da70ffff41cc7eaf90726818f544cf498798 (patch) | |
tree | cf00c5bcab495e3eabf72f961bccec80abb42910 | |
parent | 835d67f6c7e78dd730d9ab7e55af23612d644067 (diff) | |
download | bcm5719-llvm-aae9da70ffff41cc7eaf90726818f544cf498798.tar.gz bcm5719-llvm-aae9da70ffff41cc7eaf90726818f544cf498798.zip |
Fix for the greendragon bots.
Adds extra checks for ObjC GC and Ownership.
llvm-svn: 360225
-rw-r--r-- | clang/lib/Sema/SemaType.cpp | 4 | ||||
-rw-r--r-- | clang/test/SemaObjC/mrc-weak.m | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp index 17dbba921c4..4c7c13e9e2b 100644 --- a/clang/lib/Sema/SemaType.cpp +++ b/clang/lib/Sema/SemaType.cpp @@ -7612,7 +7612,9 @@ static void processTypeAttrs(TypeProcessingState &state, QualType &type, // 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( diff --git a/clang/test/SemaObjC/mrc-weak.m b/clang/test/SemaObjC/mrc-weak.m index af7081b53f8..e5f407c9d84 100644 --- a/clang/test/SemaObjC/mrc-weak.m +++ b/clang/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}} } |