aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2009-12-07 20:09:25 +0000
committerFariborz Jahanian <fjahanian@apple.com>2009-12-07 20:09:25 +0000
commit6d910f07d8727c22e06cff2357bbc1bba25d0910 (patch)
tree0fcb196d2a6e94127fcb9cd5914febd2b1531a6f /lib
parent91f8860de5f4280607e74c9d653751cd3f891ca7 (diff)
Allow accessing 'isa' via '->' operator.
(fixes radar 7447251). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90795 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Sema/SemaExpr.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 6c5a1ec05c..b3c5c9fc20 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -2522,6 +2522,16 @@ Sema::LookupMemberExpr(LookupResult &R, Expr *&BaseExpr,
// If this is an Objective-C pseudo-builtin and a definition is provided then
// use that.
if (BaseType->isObjCIdType()) {
+ if (IsArrow) {
+ // Handle the following exceptional case PObj->isa.
+ if (const ObjCObjectPointerType *OPT =
+ BaseType->getAs<ObjCObjectPointerType>()) {
+ if (OPT->getPointeeType()->isSpecificBuiltinType(BuiltinType::ObjCId) &&
+ MemberName.getAsIdentifierInfo()->isStr("isa"))
+ return Owned(new (Context) ObjCIsaExpr(BaseExpr, false, MemberLoc,
+ Context.getObjCIdType()));
+ }
+ }
// We have an 'id' type. Rather than fall through, we check if this
// is a reference to 'isa'.
if (BaseType != Context.ObjCIdRedefinitionType) {