[all-commits] [llvm/llvm-project] 24364c: [clang][CodeComplete] Make completion work after i...

kadir çetinkaya via All-commits all-commits at lists.llvm.org
Thu Jan 23 06:32:52 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 24364cd12bbfa2e58fa74bfb49d4ea85c64c0951
      https://github.com/llvm/llvm-project/commit/24364cd12bbfa2e58fa74bfb49d4ea85c64c0951
  Author: Kadir Cetinkaya <kadircet at google.com>
  Date:   2020-01-23 (Thu, 23 Jan 2020)

  Changed paths:
    M clang/lib/Parse/ParseExpr.cpp
    M clang/test/CodeCompletion/call.cpp

  Log Message:
  -----------
  [clang][CodeComplete] Make completion work after initializer lists

Summary:
CodeCompletion was not being triggered after successfully parsed
initializer lists, e.g.

```cpp
void foo(int, bool);
void bar() {
  foo({1}^, false);
}
```

CodeCompletion would suggest the function foo as an overload candidate up until
the point marked with `^` but after that point we do not trigger signature help
since parsing succeeds.

This patch handles that case by failing in parsing expression lists whenever we
see a codecompletion token, in addition to getting an invalid subexpression.

Reviewers: sammccall

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D73177




More information about the All-commits mailing list