<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
No change:<br>
<br>
visiting func decl: f<br>
visiting func decl: g<br>
visiting func decl: main<br>
<br>
Also with:<br>
ci->getDiagnostics().setSuppressAllDiagnostics(false);<br>
<br>
file.cc:1:10: fatal error: 'iostream' file not found<br>
#include <iostream><br>
visiting func decl: f<br>
visiting func decl: g<br>
visiting func decl: main<br>
<br>
also h() shows up for #include <iostream_adsf> in both:<br>
$ clang-query file.cc --<br>
clang-query> m functionTemplateDecl()<br>
<br>
and, <br>
$ clang -Xclang -ast-dump -fsyntax-only file.cc<br>
<br>
<div class="moz-cite-prefix">On 12/01/2014 04:01 PM, Nikola
Smiljanic wrote:<br>
</div>
<blockquote
cite="mid:CAGq7tnMXhun4JaG7zHMyGarCFUXBYjqdPm3Yy8+wcRxTSEat3Q@mail.gmail.com"
type="cite">
<div dir="ltr">What happens if you add a call to template function
inside main?
<div><br>
</div>
<div>h(1);</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Tue, Dec 2, 2014 at 8:11 AM, John P.
Feltz <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:jfeltz@gmail.com" target="_blank">jfeltz@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF"> Did you look at my
failing test-case that I attached earlier? Specifically:<br>
<br>
...<br>
class Vis : public RecursiveASTVisitor<Vis> {<br>
public:<br>
Vis(SourceManager& sm_) : sm(sm_) {}<br>
<br>
bool VisitFunctionTemplateDecl(FunctionTemplateDecl *tf)
{<br>
std::cout << "visiting template func decl"
<< std::endl; <br>
return true;<br>
}<br>
bool VisitFunctionDecl(FunctionDecl *f) {<br>
std::cout << "visiting func decl: " <<
f->getNameInfo().getAsString() << std::endl; <br>
return true;<br>
}<br>
<br>
SourceManager& sm;<br>
}; <br>
...<br>
<br>
Neither functions find h().
<div>
<div class="h5"><br>
<br>
<div>On 11/29/2014 08:40 PM, James Dennett wrote:<br>
</div>
<blockquote type="cite">
<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
moz-do-not-send="true"
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 moz-do-not-send="true"
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-wrap"
target="_blank">getDescribedFunctionTemplate</a> on
it to get the associated
FunctionTemplateDecl.<br>
</div>
<div><br>
</div>
<div>-- James</div>
<div><br>
</div>
</div>
</div>
</div>
</blockquote>
<br>
</div>
</div>
</div>
<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a moz-do-not-send="true" href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a moz-do-not-send="true"
href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev"
target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</body>
</html>