summaryrefslogtreecommitdiff
path: root/test/CodeCompletion/tag.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-09-18 17:42:29 +0000
committerDouglas Gregor <dgregor@apple.com>2009-09-18 17:42:29 +0000
commit33224e61bfca370850abae89bbd415a4dabe07fa (patch)
tree2ecd0a1991f2e7494615d765d8f8e625fa7d8a7d /test/CodeCompletion/tag.cpp
parent9436ed50b0923368d5ae7a97f1b67c56b6837430 (diff)
downloadclang-33224e61bfca370850abae89bbd415a4dabe07fa.tar.gz
clang-33224e61bfca370850abae89bbd415a4dabe07fa.tar.bz2
clang-33224e61bfca370850abae89bbd415a4dabe07fa.tar.xz
For code completion in C++ member access expressions and tag names,
look into the current scope for anything that could start a nested-names-specifier. These results are ranked worse than any of the results actually found in the lexical scope. Perform a little more pruning of the result set, eliminating constructors, __va_list_tag, and any duplication of declarations in the result set. For the latter, implemented NamespaceDecl::getCanonicalDecl. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82231 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeCompletion/tag.cpp')
-rw-r--r--test/CodeCompletion/tag.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/CodeCompletion/tag.cpp b/test/CodeCompletion/tag.cpp
new file mode 100644
index 0000000000..addad9d769
--- /dev/null
+++ b/test/CodeCompletion/tag.cpp
@@ -0,0 +1,20 @@
+// RUN: clang-cc -fsyntax-only -code-completion-dump=1 %s -o - | FileCheck -check-prefix=CC1 %s &&
+// RUN: true
+
+class X { };
+struct Y { };
+
+namespace N {
+ template<typename> class Z;
+}
+
+namespace N {
+ class Y;
+
+ void test() {
+ // CHECK-CC1: Y : 2
+ // CHECK-CC1: Z : 2
+ // CHECK-CC1: X : 3
+ // CHECK-CC1: Y : 3
+ // CHECK-CC1: N : 6
+ class