diff options
| author | Steve Naroff <snaroff@apple.com> | 2008-10-20 22:53:06 +0000 |
|---|---|---|
| committer | Steve Naroff <snaroff@apple.com> | 2008-10-20 22:53:06 +0000 |
| commit | bca9fd755df2ed7bf72f458c8e7e0cdaa6814f57 (patch) | |
| tree | 64443618805cd9c939af44a461407164ee272192 /clang/lib | |
| parent | 7e721ecd217e3eabf3c718ff8617aa1cdecdf00c (diff) | |
| download | bcm5719-llvm-bca9fd755df2ed7bf72f458c8e7e0cdaa6814f57.tar.gz bcm5719-llvm-bca9fd755df2ed7bf72f458c8e7e0cdaa6814f57.zip | |
Fix <rdar://problem/6268365> Parser rejects property (dot notation) access on id<protocol>.
llvm-svn: 57850
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 1f885165cd9..5ff8b0e59fb 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -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). |

