<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hello all,</p>
<p>I have asked the same question at stackoverflow
(<a class="moz-txt-link-freetext" href="https://stackoverflow.com/questions/70095653/get-the-sourcerange-of-explicit-template-instantiations-using-clang-ast-library">https://stackoverflow.com/questions/70095653/get-the-sourcerange-of-explicit-template-instantiations-using-clang-ast-library</a>)
but so far, there is no response.</p>
<p>I want to get the SourceRange of a whole explicit instantiation
statement.<br>
For example in this code snippet:</p>
<p>```<code class="hljs language-cpp"><span class="hljs-number"><br>
1</span> <span class="hljs-comment">//file my_func.cpp</span></code><code
class="hljs language-cpp"><span class="hljs-number"><br>
2</span> <span class="hljs-function"><span class="hljs-type">void</span>
<span class="hljs-keyword">template</span><<span
class="hljs-keyword">typename</span> Bar> <span
class="hljs-title">foo</span><span class="hljs-params">(Bar&
bar)</span> </span>{</code><code class="hljs language-cpp"><span
class="hljs-number"><br>
3</span> <span class="hljs-comment">// some code</span></code><code
class="hljs language-cpp"><span class="hljs-number"><br>
4</span> }</code><code class="hljs language-cpp"><span
class="hljs-number"><br>
5</span> <span class="hljs-keyword">template</span> <span
class="hljs-type">void</span> <span class="hljs-built_in">foo</span><<span
class="hljs-type">double</span>>(<span class="hljs-type">double</span>&);</code><br>
```</p>
<p>I want to get the beginning and the end of the statement in line
5 as a clang::SourceLocation.</p>
<p>I have tried
FunctionTemplateSpecializationInfo::getPointOfInstantiation which
would give for the above example line 5 and column 15 (the begin
of foo).</p>
<p>Is there a way to get the begin and the end of the whole
statement?</p>
<p>Thanks and best regards,<br>
Matthias Peschke<br>
</p>
</body>
</html>