From ebf0a6d75dcb5715d5bf7097e749a4249d01e956 Mon Sep 17 00:00:00 2001 From: Ilya Biryukov Date: Wed, 7 Nov 2018 10:02:31 +0000 Subject: [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 --- clang/test/CodeCompletion/ordinary-name.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'clang/test/CodeCompletion/ordinary-name.cpp') diff --git a/clang/test/CodeCompletion/ordinary-name.cpp b/clang/test/CodeCompletion/ordinary-name.cpp index 03dbbcaf744..ba613bc9152 100644 --- a/clang/test/CodeCompletion/ordinary-name.cpp +++ b/clang/test/CodeCompletion/ordinary-name.cpp @@ -171,7 +171,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++98 %s -o - | FileCheck -check-prefix=CHECK-NO-RTTI %s -- cgit v1.2.3