// Check the use of this method.
if (DiagnoseUseOfDecl(OMD, MemberLoc))
return ExprError();
-
+ // It is important that start and end position is the first character
+ // and last character position of the property-dot syntax expression.
+ SourceLocation MemberEndLoc = PP.getLocForEndOfToken(MemberLoc, 1);
return Owned(ObjCMessageExpr::Create(Context,
OMD->getSendResultType(),
- OpLoc, BaseExpr, Sel,
- OMD, NULL, 0, MemberLoc));
+ BaseExpr->getExprLoc(),
+ BaseExpr, Sel,
+ OMD, NULL, 0, MemberEndLoc));
}
}
--- /dev/null
+// RUN: %clang_cc1 -x objective-c++ -Wno-return-type -fblocks -fms-extensions -rewrite-objc %s -o %t-rw.cpp
+// RUN: %clang_cc1 -fsyntax-only -fblocks -Wno-address-of-temporary -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
+// rdar:// 8520727
+
+void *sel_registerName(const char *);
+
+@class NSString;
+
+@protocol CoreDAVAccountInfoProvider
+- (NSString *)userAgentHeader;
+@end
+
+@interface CoreDAVTask
+{
+ id<CoreDAVAccountInfoProvider> _accountInfoProvider;
+}
+- (void)METHOD;
+@end
+
+@implementation CoreDAVTask
+- (void)METHOD {
+ if ([_accountInfoProvider userAgentHeader]) {
+ }
+ if (_accountInfoProvider.userAgentHeader) {
+ }
+}
+@end
+