]> granicus.if.org Git - clang/commitdiff
Fix <rdar://problem/6268365> Parser rejects property (dot notation) access on id...
authorSteve Naroff <snaroff@apple.com>
Mon, 20 Oct 2008 22:53:06 +0000 (22:53 +0000)
committerSteve Naroff <snaroff@apple.com>
Mon, 20 Oct 2008 22:53:06 +0000 (22:53 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57850 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaExpr.cpp
test/SemaObjC/property-9.m

index 1f885165cd9d9ad56d9ac4293c6a483622d2f274..5ff8b0e59fbf17382db4c99362a16e653a2ea017 100644 (file)
@@ -999,7 +999,15 @@ ActOnMemberReferenceExpr(ExprTy *Base, SourceLocation OpLoc,
                                      MemberLoc, BaseExpr);
     }
   }
-  
+  // Handle properties on qualified "id" protocols.
+  const ObjCQualifiedIdType *QIdTy;
+  if (OpKind == tok::period && (QIdTy = BaseType->getAsObjCQualifiedIdType())) {
+    // Check protocols on qualified interfaces.
+    for (ObjCQualifiedIdType::qual_iterator I = QIdTy->qual_begin(),
+         E = QIdTy->qual_end(); I != E; ++I)
+      if (ObjCPropertyDecl *PD = (*I)->FindPropertyDeclaration(&Member))
+        return new ObjCPropertyRefExpr(PD, PD->getType(), MemberLoc, BaseExpr);
+  }  
   // Handle 'field access' to vectors, such as 'V.xx'.
   if (BaseType->isExtVectorType() && OpKind == tok::period) {
     // Component access limited to variables (reject vec4.rg.g).
index a1f29e6f98370fca600bbb6b8beb62a86c7c6313..03c2ba05ae74b3f9845d52697a08ac1eb7a7fd76 100644 (file)
@@ -62,3 +62,23 @@ typedef signed char BOOL;
 
 @end
 
+@protocol PVImageViewProtocol
+@property int inEyeDropperMode;
+@end
+
+@interface Cls
+@property int inEyeDropperMode;
+@end
+
+@interface PVAdjustColor @end
+
+@implementation PVAdjustColor
+
+- xx {
+  id <PVImageViewProtocol> view;
+  Cls *c;
+
+  c.inEyeDropperMode = 1;
+  view.inEyeDropperMode = 1;
+}
+@end