s(3);
}
+namespace NS {
+ namespace Inn {}
+ typedef int Foo;
+}
+
+using namespace NS;
+using namespace NS::Inn;
+using NS::Foo;
+
+
// RUN: c-index-test -index-file %s | FileCheck %s
// CHECK: [indexDeclaration]: kind: namespace | name: NS
// CHECK-NEXT: [indexDeclaration]: kind: variable | name: gx
// CHECK-NEXT: [indexEntityReference]: kind: c++-instance-method | name: operator=
// CHECK-NEXT: [indexEntityReference]: kind: c++-instance-method | name: operator!=
// CHECK-NEXT: [indexEntityReference]: kind: c++-instance-method | name: operator()
+
+// CHECK: [indexEntityReference]: kind: namespace | name: NS | {{.*}} | loc: 42:17
+// CHECK-NEXT: [indexEntityReference]: kind: namespace | name: NS | {{.*}} | loc: 43:17
+// CHECK-NEXT: [indexEntityReference]: kind: namespace | name: Inn | {{.*}} | loc: 43:21
+// CHECK-NEXT: [indexEntityReference]: kind: namespace | name: NS | {{.*}} | loc: 44:7
+// CHECK-NEXT: [indexEntityReference]: kind: typedef | name: Foo | {{.*}} | loc: 44:11
return true;
}
+ bool VisitUsingDecl(UsingDecl *D) {
+ // FIXME: Parent for the following is CXIdxEntity_Unexposed with no USR,
+ // we should do better.
+
+ IndexCtx.indexNestedNameSpecifierLoc(D->getQualifierLoc(), D);
+ for (UsingDecl::shadow_iterator
+ I = D->shadow_begin(), E = D->shadow_end(); I != E; ++I) {
+ IndexCtx.handleReference((*I)->getUnderlyingDecl(), D->getLocation(),
+ D, D->getLexicalDeclContext());
+ }
+ return true;
+ }
+
+ bool VisitUsingDirectiveDecl(UsingDirectiveDecl *D) {
+ // FIXME: Parent for the following is CXIdxEntity_Unexposed with no USR,
+ // we should do better.
+
+ IndexCtx.indexNestedNameSpecifierLoc(D->getQualifierLoc(), D);
+ IndexCtx.handleReference(D->getNominatedNamespaceAsWritten(),
+ D->getLocation(), D, D->getLexicalDeclContext());
+ return true;
+ }
+
bool VisitClassTemplateDecl(ClassTemplateDecl *D) {
IndexCtx.handleClassTemplate(D);
if (D->isThisDeclarationADefinition())