summaryrefslogtreecommitdiffstats
path: root/clang/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
commitfead6ae660ac5f4548250f972ccbd905a038132a (patch)
tree9ac0d1dbe776bb032f61edbc10e02bc26c540d17 /clang/test/CodeCompletion/ignore-ns-level-decls.cpp
parent0a075d68ecd2e5c3cbf220557621a3753306698f (diff)
downloadbcm5719-llvm-fead6ae660ac5f4548250f972ccbd905a038132a.tar.gz
bcm5719-llvm-fead6ae660ac5f4548250f972ccbd905a038132a.zip
[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 llvm-svn: 320563
Diffstat (limited to 'clang/test/CodeCompletion/ignore-ns-level-decls.cpp')
-rw-r--r--clang/test/CodeCompletion/ignore-ns-level-decls.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/clang/test/CodeCompletion/ignore-ns-level-decls.cpp b/clang/test/CodeCompletion/ignore-ns-level-decls.cpp
new file mode 100644
index 00000000000..59cee6536a5
--- /dev/null
+++ b/clang/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: {{^}}{{$}}
+}
OpenPOWER on IntegriCloud