diff options
author | Ted Kremenek <kremenek@apple.com> | 2012-08-29 22:54:47 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2012-08-29 22:54:47 +0000 |
commit | 9af9122067f1334806a5f22ce907a3209490d506 (patch) | |
tree | 7602f063a58b4726bea18529d90084f6b0572f11 /lib/Sema/SemaDeclAttr.cpp | |
parent | 97d3f3b0f85a6e1ba1c6de689246953a33ea987b (diff) |
Fix serious regression introduced in r157780 where __attribute__((NSObject))
could not be attached to a CFTypeRef.
Fixes <rdar://problem/12197822>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162872 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclAttr.cpp')
-rw-r--r-- | lib/Sema/SemaDeclAttr.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index fcfa574d59..2426845312 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/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; } |