structured document comment: patch to provide comment for overriding function
template when comment is comming from overridden declaration. 
// rdar://12378793


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165953 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/Comment.cpp b/lib/AST/Comment.cpp
index a443b91..a235b60 100644
--- a/lib/AST/Comment.cpp
+++ b/lib/AST/Comment.cpp
@@ -310,6 +310,21 @@
   return Args[0].Text;
 }
 
+StringRef TParamCommandComment::getParamName(comments::FullComment *FC) const {
+  if (FC && isPositionValid()) {
+    const TemplateParameterList *TPL = FC->getThisDeclInfo()->TemplateParameters;
+    for (unsigned i = 0, e = getDepth(); i != e; ++i) {
+      if (i == e-1)
+        return TPL->getParam(getIndex(i))->getName();
+      const NamedDecl *Param = TPL->getParam(getIndex(i));
+      if (const TemplateTemplateParmDecl *TTP =
+          dyn_cast<TemplateTemplateParmDecl>(Param))
+        TPL = TTP->getTemplateParameters();
+    }
+  }
+  return Args[0].Text;
+}
+  
 } // end namespace comments
 } // end namespace clang