diff options
Diffstat (limited to 'clang/lib/Parse/ParseExpr.cpp')
| -rw-r--r-- | clang/lib/Parse/ParseExpr.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/Parse/ParseExpr.cpp b/clang/lib/Parse/ParseExpr.cpp index d3bb2bbc24e..0c14f62d725 100644 --- a/clang/lib/Parse/ParseExpr.cpp +++ b/clang/lib/Parse/ParseExpr.cpp @@ -1652,6 +1652,7 @@ Parser::ParsePostfixExpressionSuffix(ExprResult LHS) { if (Tok.is(tok::code_completion)) { QualType PreferredType = Actions.ProduceCallSignatureHelp( getCurScope(), LHS.get(), None, PT.getOpenLocation()); + CalledSignatureHelp = true; Actions.CodeCompleteExpression(getCurScope(), PreferredType); cutOffParsing(); return ExprError(); @@ -1662,9 +1663,19 @@ Parser::ParsePostfixExpressionSuffix(ExprResult LHS) { if (ParseExpressionList(ArgExprs, CommaLocs, [&] { QualType PreferredType = Actions.ProduceCallSignatureHelp( getCurScope(), LHS.get(), ArgExprs, PT.getOpenLocation()); + CalledSignatureHelp = true; Actions.CodeCompleteExpression(getCurScope(), PreferredType); })) { (void)Actions.CorrectDelayedTyposInExpr(LHS); + // If we got an error when parsing expression list, we don't call + // the CodeCompleteCall handler inside the parser. So call it here + // to make sure we get overload suggestions even when we are in the + // middle of a parameter. + if (PP.isCodeCompletionReached() && !CalledSignatureHelp) { + Actions.ProduceCallSignatureHelp(getCurScope(), LHS.get(), + ArgExprs, PT.getOpenLocation()); + CalledSignatureHelp = true; + } LHS = ExprError(); } else if (LHS.isInvalid()) { for (auto &E : ArgExprs) |

