<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/153773>153773</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang reports partial source locations when function bodies are skipped
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
kadircet
</td>
</tr>
</table>
<pre>
a.cc:
```cpp
void foo() { return; }
```
`clang -xc++ -fsyntax-only -Xclang=-ast-dump a.cc` reports full range for `foo` as expected `FunctionDecl 0x55c55160e3c0 <a.cc:1:1, col:22> col:6 foo 'void ()'`
whereas if we skip function bodies with
`clang -xc++ -fsyntax-only -Xclang=-ast-dump a.cc -Xclang=-skip-function-bodies`, we get source range only for the declaration, `FunctionDecl 0x55f97e0f5770 <a.cc:1:1, col:10> col:6 foo 'void ()'`.
Even if we skip function bodies, we still know the full source range associated with those. Reporting accurate source locations here should at least help source tools provide more accurate information with lower parsing times.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJykVM2OszgQfBpzaYGMHSAcOORn8gB72mvHbsA7Dka2STJvvzJJdmY1n0af9EkgDHZ3dVVXgyGYYSLqWLVn1THDJY7Od--ojVcUs7PTHx0WSjG5Y3zHav641Dwzvrs6o6F3joktEy2wZg-e4uInJvfAmuPXiLReX5XFaYD8rpjYM7GHvA8fU8R77ib7Afnf6z6TxxxDzPVymWHFrzl4mp2PAfrFWvA4DQS988BqnmqoOWAAus-kIun09bRMKho3HUlZ4PeqUlVV1pyk4sDk4UmrXG9xAOUskzshmHx7rutEDphoVqIPlkw0_7G5jeQJA5gebgTh3czQPzHh7LShADcTxz_h_XUjAeQvgPwBkGoRhwQ_UITgFq_oqc2aNwkURwJNyqLHFJnO_0qdvm2I91XT_KBOyX9HneIhz9uVph-0edYdorEW3id3Wwtdm_s_HhiCUwZTU5OaEEcXqIC_VjeYaQBUavEY6RVmnVqJBkj9gTC6xWrACJYwRBjJzq-j0TkbYPbuajTBxXn6zGam3vnLmukBbN2NPMzoQ0KN5kKhyHQndStbzKgrm6oSleDtJhu7Um7bUtd9i4q2Qm7K-tyiRl5uRKmEkpnpBBcV35ZVyXkpN0XdKBSV3ugzr1u9rdmG0wWNLay9Xgrnh8yEsFBXVrJpZGbxTDasgyvEwyNCpBn2XQrIz8sQ2IZbE2L4TBFNtNQdVi--5mlGHw3a7_LdRpq-ORr9o50z6WzxthtjnEP6PYgTE6fBxHE5F8pdmDgl1Ocjn737h1Rk4rSyCEycnkSunfg3AAD__wRldQA">