From: Douglas Gregor Date: Wed, 15 Sep 2010 14:54:45 +0000 (+0000) Subject: Extend bracket insertion to handle nullary selectors, e.g. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b65042da3aa4dc2f9fc1c606fa6817089fd86cd6;p=clang Extend bracket insertion to handle nullary selectors, e.g. a getFoo] git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113969 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Parse/ParseExpr.cpp b/lib/Parse/ParseExpr.cpp index 1f5a6964e3..e466af2d61 100644 --- a/lib/Parse/ParseExpr.cpp +++ b/lib/Parse/ParseExpr.cpp @@ -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; diff --git a/test/FixIt/fixit-objc-message.m b/test/FixIt/fixit-objc-message.m index 0eaa7f0547..f19b489f99 100644 --- a/test/FixIt/fixit-objc-message.m +++ b/test/FixIt/fixit-objc-message.m @@ -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]; }