<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sat, Nov 29, 2014 at 2:48 PM, John P. Feltz <span dir="ltr"><<a href="mailto:jfeltz@gmail.com" target="_blank">jfeltz@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi,<br>
<br>
I can't seem to traverse the following with either a RecursiveASTVisitor or a AST Matcher converted to an ASTConsumer:<br>
<br>
template<typename T> void h(T x) { .. }<br>
<br>
First some things I'd like to note:<br>
1) $ llvm-config --version<br>
3.5.0<br>
<br>
2) 'clang' actually does find the template function, so I suspect I'm doing something wrong in either the visitor and matcher, or in the compiler setup:<br>
$ clang -Xclang -ast-dump -fsyntax-only file.cc<br>
..<br>
FunctionTemplateDecl 0x23e5330 <line:13:1, line:15:1> line:13:27 h<br>
..<br>
<br>
3) I am not a C++ expert, and I am a libtooling newbie.<br>
<br>
I've attached the parsed subject (file.cc) and the code I'm using to build and run the test-case.<br>
<br></blockquote><div><br></div><div>You might try visiting the FunctionDecl and then calling <a class="" href="https://cs.corp.google.com/#piper///depot/google3/third_party/llvm/llvm/tools/clang/include/clang/AST/Decl.h&ct=xref_jump_to_def&cl=GROK&l=2013&gsn=getDescribedFunctionTemplate" style="text-decoration:none;color:rgb(85,26,139);font-family:monospace;font-size:medium;line-height:16.25px;white-space:pre">getDescribedFunctionTemplate</a> on it to get the associated FunctionTemplateDecl.<br></div><div><br></div><div>-- James</div><div><br></div></div></div></div>