diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-04-05 21:04:10 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-04-05 21:04:10 +0000 |
commit | 516143b619d1eccfef023ceaf91666803f04cc83 (patch) | |
tree | 4affa6ce2c9033327639b7faac404b226fbda625 /tools | |
parent | 8aa86d1155fb99e34fd084d83da3345b1ec2b2e4 (diff) |
[libclang] Fix cursor visitation to not ignore template arguments in out-of-line member functions.
rdar://13535645
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178911 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/libclang/CIndex.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp index a81f1e437d..18821aaa45 100644 --- a/tools/libclang/CIndex.cpp +++ b/tools/libclang/CIndex.cpp @@ -723,6 +723,13 @@ bool CursorVisitor::VisitEnumConstantDecl(EnumConstantDecl *D) { } bool CursorVisitor::VisitDeclaratorDecl(DeclaratorDecl *DD) { + unsigned NumParamList = DD->getNumTemplateParameterLists(); + for (unsigned i = 0; i < NumParamList; i++) { + TemplateParameterList* Params = DD->getTemplateParameterList(i); + if (VisitTemplateParameters(Params)) + return true; + } + if (TypeSourceInfo *TSInfo = DD->getTypeSourceInfo()) if (Visit(TSInfo->getTypeLoc())) return true; @@ -751,6 +758,13 @@ static int CompareCXXCtorInitializers(const void* Xp, const void *Yp) { } bool CursorVisitor::VisitFunctionDecl(FunctionDecl *ND) { + unsigned NumParamList = ND->getNumTemplateParameterLists(); + for (unsigned i = 0; i < NumParamList; i++) { + TemplateParameterList* Params = ND->getTemplateParameterList(i); + if (VisitTemplateParameters(Params)) + return true; + } + if (TypeSourceInfo *TSInfo = ND->getTypeSourceInfo()) { // Visit the function declaration's syntactic components in the order // written. This requires a bit of work. |