From ef4ece75fdb48b06ab4b8cd087a6fc64b44d5978 Mon Sep 17 00:00:00 2001 From: Ilya Biryukov Date: Wed, 25 Apr 2018 15:13:34 +0000 Subject: [CodeComplete] Fix completion in the middle of ident in ctor lists. Summary: The example that was broken before (^ designates completion points): class Foo { Foo() : fie^ld^() {} // no completions were provided here. int field; }; To fix it we don't cut off lexing after an identifier followed by code completion token is lexed. Instead we skip the rest of identifier and continue lexing. This is consistent with behavior of completion when completion token is right before the identifier. Reviewers: sammccall, aaron.ballman, bkramer, sepavloff, arphaman, rsmith Reviewed By: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D44932 llvm-svn: 330833 --- clang/test/CodeCompletion/end-of-file.cpp | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 clang/test/CodeCompletion/end-of-file.cpp (limited to 'clang/test/CodeCompletion/end-of-file.cpp') diff --git a/clang/test/CodeCompletion/end-of-file.cpp b/clang/test/CodeCompletion/end-of-file.cpp new file mode 100644 index 00000000000..178ef4561f5 --- /dev/null +++ b/clang/test/CodeCompletion/end-of-file.cpp @@ -0,0 +1,7 @@ +// Check that clang does not crash when completing at the last char in the +// buffer. +// NOTE: This file must *NOT* have newline at the end. +// RUN: %clang_cc1 -code-completion-at=%s:7:2 %s | FileCheck %s +// CHECK: COMPLETION: foo +using foo = int***; +f \ No newline at end of file -- cgit v1.2.3