summaryrefslogtreecommitdiff
path: root/test/CodeCompletion/ignore-ns-level-decls.cpp
diff options
context:
space:
mode:
authorEric Liu <ioeric@google.com>2017-12-13 10:26:49 +0000
committerEric Liu <ioeric@google.com>2017-12-13 10:26:49 +0000
commit979ce58814f6d861f8a9a4da08932916bafd38d9 (patch)
tree53c9d1f9308225fde052cfd5b01ce6768ec51300 /test/CodeCompletion/ignore-ns-level-decls.cpp
parent93d27e381244aa4c5782ad418812f9612bb12b39 (diff)
downloadclang-979ce58814f6d861f8a9a4da08932916bafd38d9.tar.gz
[Sema] Ignore decls in namespaces when global decls are not wanted.
Summary: ... in qualified code completion and decl lookup. Reviewers: ilya-biryukov, arphaman Reviewed By: ilya-biryukov Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D40562 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@320563 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeCompletion/ignore-ns-level-decls.cpp')
-rw-r--r--test/CodeCompletion/ignore-ns-level-decls.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/CodeCompletion/ignore-ns-level-decls.cpp b/test/CodeCompletion/ignore-ns-level-decls.cpp
new file mode 100644
index 0000000000..59cee6536a
--- /dev/null
+++ b/test/CodeCompletion/ignore-ns-level-decls.cpp
@@ -0,0 +1,21 @@
+namespace ns {
+ struct bar {
+ };
+
+ struct baz {
+ };
+
+ int func(int a, bar b, baz c);
+}
+
+void test() {
+ ns::
+// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:12:7 %s -o - | FileCheck %s --check-prefix=CHECK-1
+// CHECK-1-DAG: COMPLETION: bar : bar
+// CHECK-1-DAG: COMPLETION: baz : baz
+// CHECK-1-DAG: COMPLETION: func : [#int#]func(<#int a#>, <#bar b#>, <#baz c#>)
+
+// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:12:7 -no-code-completion-ns-level-decls %s -o - | FileCheck %s --allow-empty --check-prefix=CHECK-EMPTY
+// CHECK-EMPTY-NOT: COMPLETION: bar : bar
+// CHECK-EMPTY: {{^}}{{$}}
+}