Non-pointer objects are none gc'able regardles of

the attribute set on them.

llvm-svn: 68844
This commit is contained in:
Fariborz Jahanian 2009-04-11 00:00:54 +00:00
parent 4d59f88e60
commit d381cde486
2 changed files with 26 additions and 0 deletions

View File

@ -2694,6 +2694,10 @@ QualType::GCAttrTypes ASTContext::getObjCGCAttrKind(const QualType &Ty) const {
else if (Ty->isPointerType())
return getObjCGCAttrKind(Ty->getAsPointerType()->getPointeeType());
}
// Non-pointers have none gc'able attribute regardless of the attribute
// set on them.
else if (!isObjCObjectPointerType(Ty) && !Ty->isPointerType())
return QualType::GCNone;
}
return GCAttrs;
}

View File

@ -0,0 +1,22 @@
// RUN: clang-cc -emit-llvm -o %t %s
@interface PDFViewPrivateVars
{
@public
__attribute__((objc_gc(strong))) char *addedTooltips;
}
@end
@interface PDFView
{
PDFViewPrivateVars *_pdfPriv;
}
@end
@implementation PDFView
- (void) addTooltipsForPage
{
_pdfPriv->addedTooltips[4] = 1;
}
@end