forked from OSchip/llvm-project
Non-pointer objects are none gc'able regardles of
the attribute set on them. llvm-svn: 68844
This commit is contained in:
parent
4d59f88e60
commit
d381cde486
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
Loading…
Reference in New Issue