Extend bracket insertion to handle nullary selectors, e.g.

a getFoo]

llvm-svn: 113969
This commit is contained in:
Douglas Gregor 2010-09-15 14:54:45 +00:00
parent e9bba4f1a4
commit d6d980044e
2 changed files with 3 additions and 1 deletions

View File

@ -984,7 +984,7 @@ Parser::ParsePostfixExpressionSuffix(ExprResult LHS) {
// message send, then this is probably a message send with a missing
// opening bracket '['.
if (getLang().ObjC1 && !InMessageExpression &&
NextToken().is(tok::colon)) {
(NextToken().is(tok::colon) || NextToken().is(tok::r_square))) {
LHS = ParseObjCMessageExpressionBody(SourceLocation(), SourceLocation(),
ParsedType(), LHS.get());
break;

View File

@ -11,9 +11,11 @@
@interface A
- (int)method1:(int)x second:(float)y;
+ (int)method2:(int)x second:(double)y;
- (int)getBlah;
@end
void f(A *a, int i, int j) {
a method1:5+2 second:+(3.14159)];
a method1:[a method1:3 second:j] second:i++]
a getBlah];
}