diff options
author | Ilya Biryukov <ibiryukov@google.com> | 2018-11-07 10:02:31 +0000 |
---|---|---|
committer | Ilya Biryukov <ibiryukov@google.com> | 2018-11-07 10:02:31 +0000 |
commit | ebf0a6d75dcb5715d5bf7097e749a4249d01e956 (patch) | |
tree | 8de53754d6278f1ffac8aced98e3ba6546677362 /clang/test/CodeCompletion/ordinary-name-cxx11.cpp | |
parent | ed4bb266c8531a28399b2fab8161ff67e4eaa650 (diff) | |
download | bcm5719-llvm-ebf0a6d75dcb5715d5bf7097e749a4249d01e956.tar.gz bcm5719-llvm-ebf0a6d75dcb5715d5bf7097e749a4249d01e956.zip |
[CodeComplete] Do not complete self-initializations
Summary:
Removes references to initialized variable from the following completions:
int x = ^;
Handles only the trivial cases where the variable name is completed
immediately at the start of initializer or assignment, more complicated
cases aren't covered, e.g. these completions still contain 'x':
// More complicated expressions.
int x = foo(^);
int x = 10 + ^;
// Other kinds of initialization.
int x{^};
int x(^);
// Constructor initializers.
struct Foo {
Foo() : x(^) {}
int x;
};
We should address those in the future, but they are outside of the scope of
this initial change.
Reviewers: sammccall
Reviewed By: sammccall
Subscribers: arphaman, cfe-commits
Differential Revision: https://reviews.llvm.org/D54156
llvm-svn: 346301
Diffstat (limited to 'clang/test/CodeCompletion/ordinary-name-cxx11.cpp')
-rw-r--r-- | clang/test/CodeCompletion/ordinary-name-cxx11.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/clang/test/CodeCompletion/ordinary-name-cxx11.cpp b/clang/test/CodeCompletion/ordinary-name-cxx11.cpp index 34c3bf96a9d..0125ffbbb3c 100644 --- a/clang/test/CodeCompletion/ordinary-name-cxx11.cpp +++ b/clang/test/CodeCompletion/ordinary-name-cxx11.cpp @@ -197,7 +197,6 @@ void foo() { // CHECK-CC4-NEXT: COMPLETION: volatile // CHECK-CC4-NEXT: COMPLETION: wchar_t // CHECK-CC4-NEXT: COMPLETION: X : X - // CHECK-CC4-NEXT: COMPLETION: y : [#int#]y // CHECK-CC4-NEXT: COMPLETION: z : [#void#]z(<#int#>) // RUN: %clang_cc1 -fsyntax-only -fno-rtti -code-completion-patterns -code-completion-at=%s:6:14 -std=gnu++11 %s -o - | FileCheck -check-prefix=CHECK-NO-RTTI %s |