diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-09-01 19:52:22 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-09-01 19:52:22 +0000 |
commit | 7e24256c95afb64b4d5abf201a0f9f0527cb4cf3 (patch) | |
tree | 1756abde87154fc918dbe4d6839c0ffdbf206a62 /test/Index/load-namespaces.cpp | |
parent | 98c9d1fa3776204a94c013f1dc25f62d75c00573 (diff) |
Implement libclang support for using declarations. Clang actually uses
three different kinds of AST nodes to represent using declarations:
UsingDecl, UnresolvedUsingValueDecl, and
UnresolvedUsingTypenameDecl. These three are collapsed into a single
cursor kind for using declarations, since libclang clients don't need
the distinction.
Several related changes here:
- Cursor visitation of the three AST nodes for using declarations
- Proper source-range computation for these AST nodes
- Using declarations have no USRs, since they don't actually declare
any entities.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112730 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Index/load-namespaces.cpp')
-rw-r--r-- | test/Index/load-namespaces.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/Index/load-namespaces.cpp b/test/Index/load-namespaces.cpp index 9c8db0a3a5..adb6183d17 100644 --- a/test/Index/load-namespaces.cpp +++ b/test/Index/load-namespaces.cpp @@ -15,6 +15,12 @@ namespace std0x = std98; using namespace std0x; +namespace std { + int g(int); +} + +using std::g; + // RUN: c-index-test -test-load-source all %s | FileCheck %s // CHECK: load-namespaces.cpp:3:11: Namespace=std:3:11 (Definition) Extent=[3:11 - 7:2] // CHECK: load-namespaces.cpp:4:13: Namespace=rel_ops:4:13 (Definition) Extent=[4:13 - 6:4] @@ -27,3 +33,7 @@ using namespace std0x; // CHECK: load-namespaces.cpp:14:19: NamespaceRef=std98:13:11 Extent=[14:19 - 14:24] // CHECK: load-namespaces.cpp:16:17: UsingDirective=:16:17 Extent=[16:1 - 16:22] // CHECK: load-namespaces.cpp:16:17: NamespaceRef=std0x:14:11 Extent=[16:17 - 16:22] +// CHECK: load-namespaces.cpp:18:11: Namespace=std:18:11 (Definition) Extent=[18:11 - 20:2] +// CHECK: load-namespaces.cpp:19:7: FunctionDecl=g:19:7 Extent=[19:7 - 19:13] +// CHECK: load-namespaces.cpp:19:12: ParmDecl=:19:12 (Definition) Extent=[19:9 - 19:13] +// CHECK: load-namespaces.cpp:22:12: UsingDeclaration=g:22:12 Extent=[22:1 - 22:13] |