diff options
| author | Ivan Donchevskii <ivan.donchevskii@qt.io> | 2018-09-21 11:23:22 +0000 |
|---|---|---|
| committer | Ivan Donchevskii <ivan.donchevskii@qt.io> | 2018-09-21 11:23:22 +0000 |
| commit | 60a16ef04b8e435f1e8fbf16c960a0cf7b7a5612 (patch) | |
| tree | a4b0cdf62deb2c62e7c24db8bf1503377e7d49d7 /clang/test/CodeCompletion | |
| parent | b52bd9eed62548d84cdb85fd452ce06a3bdb320e (diff) | |
| download | bcm5719-llvm-60a16ef04b8e435f1e8fbf16c960a0cf7b7a5612.tar.gz bcm5719-llvm-60a16ef04b8e435f1e8fbf16c960a0cf7b7a5612.zip | |
[CodeComplete] Generate completion fix-its for C code as well
Current completion fix-its approach does not provide OtherOpBase for C code.
But we can easily proceed in this case taking the original Base type.
Differential Revision: https://reviews.llvm.org/D52261
llvm-svn: 342721
Diffstat (limited to 'clang/test/CodeCompletion')
| -rw-r--r-- | clang/test/CodeCompletion/member-access.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/test/CodeCompletion/member-access.c b/clang/test/CodeCompletion/member-access.c index 226e182ab15..72afbf2ff94 100644 --- a/clang/test/CodeCompletion/member-access.c +++ b/clang/test/CodeCompletion/member-access.c @@ -10,3 +10,22 @@ void test(struct Point *p) { // CHECK-CC1: x // CHECK-CC1: y // CHECK-CC1: z +} + +struct Point2 { + float x; +}; + +void test2(struct Point2 p) { + p-> +} + +void test3(struct Point2 *p) { + p. +} + +// RUN: %clang_cc1 -fsyntax-only -code-completion-with-fixits -code-completion-at=%s:20:6 %s -o - | FileCheck -check-prefix=CHECK-CC2 %s +// CHECK-CC2: x (requires fix-it: {20:4-20:6} to ".") + +// RUN: %clang_cc1 -fsyntax-only -code-completion-with-fixits -code-completion-at=%s:24:5 %s -o - | FileCheck -check-prefix=CHECK-CC3 %s +// CHECK-CC3: x (requires fix-it: {24:4-24:5} to "->") |

