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 | a9aa29cf0b171e0046111e99c555250e45b39a3b (patch) | |
tree | 310c5d35d7163d0c545d037dbfecfb5034209a0f /clang/test/Index/load-namespaces.cpp | |
parent | 61a312413c82aa23ef63467cde87f6de1ce8724f (diff) | |
download | bcm5719-llvm-a9aa29cf0b171e0046111e99c555250e45b39a3b.tar.gz bcm5719-llvm-a9aa29cf0b171e0046111e99c555250e45b39a3b.zip |
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.
llvm-svn: 112730
Diffstat (limited to 'clang/test/Index/load-namespaces.cpp')
-rw-r--r-- | clang/test/Index/load-namespaces.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/Index/load-namespaces.cpp b/clang/test/Index/load-namespaces.cpp index 9c8db0a3a52..adb6183d171 100644 --- a/clang/test/Index/load-namespaces.cpp +++ b/clang/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] |