[cfe-commits] r66659 - in /cfe/trunk: lib/Sema/SemaExpr.cpp test/SemaObjC/property-9-impl-method.m
Steve Naroff
snaroff at apple.com
Wed Mar 11 08:15:02 PDT 2009
Author: snaroff
Date: Wed Mar 11 10:15:01 2009
New Revision: 66659
URL: http://llvm.org/viewvc/llvm-project?rev=66659&view=rev
Log:
Fix <rdar://problem/6655054> clang issues bogus error on property usage in a dot-syntax.
Modified:
cfe/trunk/lib/Sema/SemaExpr.cpp
cfe/trunk/test/SemaObjC/property-9-impl-method.m
Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=66659&r1=66658&r2=66659&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Wed Mar 11 10:15:01 2009
@@ -1866,11 +1866,9 @@
// If this reference is in an @implementation, check for 'private' methods.
if (!Getter)
- if (ObjCMethodDecl *CurMeth = getCurMethodDecl())
- if (ObjCInterfaceDecl *ClassDecl = CurMeth->getClassInterface())
- if (ObjCImplementationDecl *ImpDecl =
- ObjCImplementations[ClassDecl->getIdentifier()])
- Getter = ImpDecl->getInstanceMethod(Sel);
+ if (ObjCImplementationDecl *ImpDecl =
+ ObjCImplementations[IFace->getIdentifier()])
+ Getter = ImpDecl->getInstanceMethod(Sel);
// Look through local category implementations associated with the class.
if (!Getter) {
@@ -1893,11 +1891,9 @@
if (!Setter) {
// If this reference is in an @implementation, also check for 'private'
// methods.
- if (ObjCMethodDecl *CurMeth = getCurMethodDecl())
- if (ObjCInterfaceDecl *ClassDecl = CurMeth->getClassInterface())
- if (ObjCImplementationDecl *ImpDecl =
- ObjCImplementations[ClassDecl->getIdentifier()])
- Setter = ImpDecl->getInstanceMethod(SetterSel);
+ if (ObjCImplementationDecl *ImpDecl =
+ ObjCImplementations[IFace->getIdentifier()])
+ Setter = ImpDecl->getInstanceMethod(SetterSel);
}
// Look through local category implementations associated with the class.
if (!Setter) {
Modified: cfe/trunk/test/SemaObjC/property-9-impl-method.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/property-9-impl-method.m?rev=66659&r1=66658&r2=66659&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/property-9-impl-method.m (original)
+++ cfe/trunk/test/SemaObjC/property-9-impl-method.m Wed Mar 11 10:15:01 2009
@@ -62,3 +62,33 @@
}
@end
+ at class NSImage;
+
+ at interface XCImageArchiveEntry : NSObject
+{
+ NSImage *_cachedImage;
+}
+
+ at end
+
+ at implementation XCImageArchiveEntry
+
+- (NSImage *)image
+{
+ return _cachedImage;
+}
+
+ at end
+
+ at interface XCImageArchive : NSObject
+ at end
+
+ at implementation XCImageArchive
+
+- (NSImage *)imageNamed:(NSString *)name
+{
+ XCImageArchiveEntry * entry;
+ return entry ? entry.image : ((void *)0);
+}
+
+ at end
More information about the cfe-commits
mailing list