[cfe-dev] Loss "template <class T> " in Decl::dump().

boba2001 asasasdd at mail.ru
Fri Oct 19 11:48:05 PDT 2012


Hello all!

I use RecursiveASTVisitor to pass over the top level declarations.
I determined the VisitDecl method in class derived from RecursiveASTVisitor
as:
bool MyASTVisitor::VisitDecl (Decl * D){
	D -> dump();
}

I use the test example:
--- 1.cpp ---
template <class T> void templ_a(T x){
	int b = 123;
}

int main(){
	int a = 123;
	templ_a<int>(a);
	return 0;
}
------------

My question is: why does template function have the form:
void templ_a(T x) {
    int b = 123;
}

That is lost "template <class T> ". How can I get the declaration with
"template <class T>"?



--
View this message in context: http://clang-developers.42468.n3.nabble.com/Loss-template-class-T-in-Decl-dump-tp4027582.html
Sent from the Clang Developers mailing list archive at Nabble.com.



More information about the cfe-dev mailing list