summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclAttr.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2012-08-29 22:54:47 +0000
committerTed Kremenek <kremenek@apple.com>2012-08-29 22:54:47 +0000
commit7712eef0d753b11993f2905a3d9b656294ee0f71 (patch)
tree3a512cdb29d3ea3b379206adfba73607367b0d46 /clang/lib/Sema/SemaDeclAttr.cpp
parente635db4923b7985befb4b1e63f874ecc39a75a02 (diff)
downloadbcm5719-llvm-7712eef0d753b11993f2905a3d9b656294ee0f71.tar.gz
bcm5719-llvm-7712eef0d753b11993f2905a3d9b656294ee0f71.zip
Fix serious regression introduced in r157780 where __attribute__((NSObject))
could not be attached to a CFTypeRef. Fixes <rdar://problem/12197822> llvm-svn: 162872
Diffstat (limited to 'clang/lib/Sema/SemaDeclAttr.cpp')
-rw-r--r--clang/lib/Sema/SemaDeclAttr.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp
index fcfa574d599..24268453125 100644
--- a/clang/lib/Sema/SemaDeclAttr.cpp
+++ b/clang/lib/Sema/SemaDeclAttr.cpp
@@ -2268,16 +2268,14 @@ static void handleObjCNSObject(Sema &S, Decl *D, const AttributeList &Attr) {
}
if (TypedefNameDecl *TD = dyn_cast<TypedefNameDecl>(D)) {
QualType T = TD->getUnderlyingType();
- if (!T->isPointerType() ||
- !T->getAs<PointerType>()->getPointeeType()->isRecordType()) {
+ if (!T->isCARCBridgableType()) {
S.Diag(TD->getLocation(), diag::err_nsobject_attribute);
return;
}
}
else if (ObjCPropertyDecl *PD = dyn_cast<ObjCPropertyDecl>(D)) {
QualType T = PD->getType();
- if (!T->isPointerType() ||
- !T->getAs<PointerType>()->getPointeeType()->isRecordType()) {
+ if (!T->isCARCBridgableType()) {
S.Diag(PD->getLocation(), diag::err_nsobject_attribute);
return;
}
OpenPOWER on IntegriCloud