<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><div class=""><br class=""></div><div class=""><div><blockquote type="cite" class=""><div class="">On 16 Mar 2017, at 21:05, Jusufadis Bakamovic <<a href="mailto:jbakam@gmail.com" class="">jbakam@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">How come? This is the AST representation of that piece of code (reads as CursorKind : CursorSpelling)</span></div></blockquote></div><br class=""></div></div><div class="">Well, yes, and no. In this particular case you can do the mapping. One could also use clang_Type_getTemplateArgumentAsType. But you loose this relation if you go a bit further, like: <div class=""><br class=""></div><div class="">template <typename BaseType><br class="">class BaseTemplate : public BaseType<br class="">{</div><div class=""> void bar(BaseType arg1);</div><div class="">}</div><div class=""><br class=""></div><div class="">template <typename BaseType><br class="">class RecursiveBase : public BaseTemplate<BaseType></div><div class="">{</div><div class=""> void foo(BaseType arg2);</div><div class="">}<br class=""><br class=""><div class="">You also want to know that the specialised parameter of “BaseTemplate" is “Base”</div><div class="">And you also want to know that arg1 and arg2 of the specialised “RecursiveBase” are of type “Base”</div><div class="">The methods are only accessible through the referenced raw template (ClassTemplate?), where you only have the raw template parameters.</div><div class="">It’s still possible to figure out the types in this case, yes, but it gets more and more cumbersome in the more general cases.</div><div class=""><br class=""></div><div class="">With a cursor directly at the specialised version of the template everything would already be resolved, readily usable. As you can see when dumping the tree with commandline clang. It seems just that libclang does not expose that information.</div><div class=""><br class=""></div><div class="">I was able to get this information with clang_getSpecializedCursorTemplate for partially specialised templates. But not for any other kind of specialisation. In those cases the function returns just a null cursor.</div><div class=""><br class=""></div><div class="">I might be missing something, though...</div><div class=""><br class=""></div><div class="">Michael</div></div></div><div class=""><br class=""></div></body></html>