diff options
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r-- | lib/AST/ASTContext.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 5c02100ec4..b8c74e1396 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -2417,9 +2417,14 @@ QualType::GCAttrTypes ASTContext::getObjCGCAttrKind(const QualType &Ty) const { getLangOptions().getGCMode() != LangOptions::NonGC) { GCAttrs = Ty.getObjCGCAttr(); // Default behavious under objective-c's gc is for objective-c pointers - // be treated as though they were declared as __strong. - if (GCAttrs == QualType::GCNone && isObjCObjectPointerType(Ty)) - GCAttrs = QualType::Strong; + // (or pointers to them) be treated as though they were declared + // as __strong. + if (GCAttrs == QualType::GCNone) { + if (isObjCObjectPointerType(Ty)) + GCAttrs = QualType::Strong; + else if (Ty->isPointerType()) + return getObjCGCAttrKind(Ty->getAsPointerType()->getPointeeType()); + } } return GCAttrs; } |