libclang visitation for DependentScopeDeclRefExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112975 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp
index 17afeca..d75853b 100644
--- a/tools/libclang/CIndex.cpp
+++ b/tools/libclang/CIndex.cpp
@@ -392,6 +392,7 @@
   bool VisitCXXPseudoDestructorExpr(CXXPseudoDestructorExpr *E);
   // FIXME: UnaryTypeTraitExpr has poor source-location information.
   bool VisitOverloadExpr(OverloadExpr *E);
+  bool VisitDependentScopeDeclRefExpr(DependentScopeDeclRefExpr *E);
 };
 
 } // end anonymous namespace
@@ -1636,6 +1637,31 @@
   return false;
 }
 
+bool CursorVisitor::VisitDependentScopeDeclRefExpr(
+                                                DependentScopeDeclRefExpr *E) {
+  // Visit the nested-name-specifier.
+  if (NestedNameSpecifier *Qualifier = E->getQualifier())
+    if (VisitNestedNameSpecifier(Qualifier, E->getQualifierRange()))
+      return true;
+
+  // Visit the declaration name.
+  if (VisitDeclarationNameInfo(E->getNameInfo()))
+    return true;
+
+  // Visit the explicitly-specified template arguments.
+  if (const ExplicitTemplateArgumentList *ArgList
+      = E->getOptionalExplicitTemplateArgs()) {
+    for (const TemplateArgumentLoc *Arg = ArgList->getTemplateArgs(),
+         *ArgEnd = Arg + ArgList->NumTemplateArgs;
+         Arg != ArgEnd; ++Arg) {
+      if (VisitTemplateArgumentLoc(*Arg))
+        return true;
+    }
+  }
+
+  return false;
+}
+
 bool CursorVisitor::VisitObjCMessageExpr(ObjCMessageExpr *E) {
   if (TypeSourceInfo *TSInfo = E->getClassReceiverTypeInfo())
     if (Visit(TSInfo->getTypeLoc()))