summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeCompletion
diff options
context:
space:
mode:
authorIlya Biryukov <ibiryukov@google.com>2018-05-14 13:50:36 +0000
committerIlya Biryukov <ibiryukov@google.com>2018-05-14 13:50:36 +0000
commitfb9dde7040988e5b5f580e74ebbeabf0fbc70651 (patch)
tree7c29a8de8029f9913a65ef963e72278fa5a580d2 /clang/test/CodeCompletion
parentbf55e6dee136d081b0858f62fcc362d74a708894 (diff)
downloadbcm5719-llvm-fb9dde7040988e5b5f580e74ebbeabf0fbc70651.tar.gz
bcm5719-llvm-fb9dde7040988e5b5f580e74ebbeabf0fbc70651.zip
[CodeComplete] Provide completion in decls even for incomplete types
Summary: This change fixes lack of completions in the following case ('^'designates completion points) : void f(^); struct Incomplete; Incomplete g(^); Reviewers: bkramer, aaron.ballman, sammccall Reviewed By: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D46639 llvm-svn: 332244
Diffstat (limited to 'clang/test/CodeCompletion')
-rw-r--r--clang/test/CodeCompletion/incomplete-ret-type.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/test/CodeCompletion/incomplete-ret-type.cpp b/clang/test/CodeCompletion/incomplete-ret-type.cpp
new file mode 100644
index 00000000000..669105e1416
--- /dev/null
+++ b/clang/test/CodeCompletion/incomplete-ret-type.cpp
@@ -0,0 +1,13 @@
+struct IncompleteType;
+int int_value;
+typedef int int_typedef;
+
+void f(in);
+IncompleteType g(in);
+// Completing should produce results even if types are incomplete.
+// Note that clang is expected to return an error code since 'in' does not resolve.
+// RUN: not %clang_cc1 -fsyntax-only -code-completion-at=%s:5:9 %s -o - | FileCheck %s
+// RUN: not %clang_cc1 -fsyntax-only -code-completion-at=%s:6:19 %s -o - | FileCheck %s
+// CHECK: COMPLETION: int{{$}}
+// CHECK: COMPLETION: int_typedef
+// CHECK: COMPLETION: int_value
OpenPOWER on IntegriCloud