mirror of
https://github.com/intel/llvm.git
synced 2026-01-27 14:50:42 +08:00
Support for objc use of property-dot syntax as receiver
in liu of a class method getter. objc++ uses a different code path and is more involved (TBD). llvm-svn: 125061
This commit is contained in:
@@ -675,6 +675,10 @@ Sema::ObjCMessageKind Sema::getObjCMessageKind(Scope *S,
|
||||
return ObjCInstanceMessage;
|
||||
|
||||
case LookupResult::Found: {
|
||||
// If the identifier is a class or not, and there is a trailing dot,
|
||||
// it's an instance message.
|
||||
if (HasTrailingDot)
|
||||
return ObjCInstanceMessage;
|
||||
// We found something. If it's a type, then we have a class
|
||||
// message. Otherwise, it's an instance message.
|
||||
NamedDecl *ND = Result.getFoundDecl();
|
||||
|
||||
21
clang/test/SemaObjC/property-dot-receiver.m
Normal file
21
clang/test/SemaObjC/property-dot-receiver.m
Normal file
@@ -0,0 +1,21 @@
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||||
// rdar://8962253
|
||||
|
||||
@interface Singleton {
|
||||
}
|
||||
+ (Singleton*) instance;
|
||||
@end
|
||||
|
||||
@implementation Singleton
|
||||
|
||||
- (void) someSelector { }
|
||||
|
||||
+ (Singleton*) instance { return 0; }
|
||||
|
||||
+ (void) compileError
|
||||
{
|
||||
[Singleton.instance someSelector]; // clang issues error here
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user