summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-07-31 15:27:48 +0000
committerDouglas Gregor <dgregor@apple.com>2012-07-31 15:27:48 +0000
commit2d8db8fe7a46e0e91dd92f2370ea11ef4e6c35c9 (patch)
tree98adb70eb935b17678c577df5de37ad83590a781 /clang/lib/Parse
parentd627ec8a0594159d790e267e4757ace1f16d19a8 (diff)
downloadbcm5719-llvm-2d8db8fe7a46e0e91dd92f2370ea11ef4e6c35c9.tar.gz
bcm5719-llvm-2d8db8fe7a46e0e91dd92f2370ea11ef4e6c35c9.zip
Tweak code-completion heuristics deciding between a lambda
code-completion and an Objective-C message send, based on Jordan's feedback. llvm-svn: 161049
Diffstat (limited to 'clang/lib/Parse')
-rw-r--r--clang/lib/Parse/ParseExprCXX.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseExprCXX.cpp b/clang/lib/Parse/ParseExprCXX.cpp
index b1ce59f28c7..592a3cc160b 100644
--- a/clang/lib/Parse/ParseExprCXX.cpp
+++ b/clang/lib/Parse/ParseExprCXX.cpp
@@ -646,7 +646,9 @@ llvm::Optional<unsigned> Parser::ParseLambdaIntroducer(LambdaIntroducer &Intro){
// in Objective-C, where this is Almost Surely meant to be a message
// send. In that case, fail here and let the ObjC message
// expression parser perform the completion.
- if (Tok.is(tok::code_completion) && !getLangOpts().ObjC1) {
+ if (Tok.is(tok::code_completion) &&
+ !(getLangOpts().ObjC1 && Intro.Default == LCD_None &&
+ !Intro.Captures.empty())) {
Actions.CodeCompleteLambdaIntroducer(getCurScope(), Intro,
/*AfterAmpersand=*/false);
ConsumeCodeCompletionToken();
OpenPOWER on IntegriCloud