aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ParseExprCXX.cpp
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
commitd48ab06b178e400ac31ef4fe649e9c33d2caf651 (patch)
treed47ada8dc8e14ad57799931ef3504a4ba7212bb5 /lib/Parse/ParseExprCXX.cpp
parent38b2186bcff61dd284552ba2e15c7a78a5b33b80 (diff)
Tweak code-completion heuristics deciding between a lambda
code-completion and an Objective-C message send, based on Jordan's feedback. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161049 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseExprCXX.cpp')
-rw-r--r--lib/Parse/ParseExprCXX.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Parse/ParseExprCXX.cpp b/lib/Parse/ParseExprCXX.cpp
index b1ce59f28c..592a3cc160 100644
--- a/lib/Parse/ParseExprCXX.cpp
+++ b/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();