<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/54653>54653</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Diagnostics: clang-tidy: support "-fdiagnostics-print-source-range-info" just like in clang
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
bfrg
</td>
</tr>
</table>
<pre>
While it is possible to pass additional compiler flags with `--extra-arg=` and `--extra-arg-before=`, passing `-fdiagnostics-print-source-range-info` doesn't seem to have an effect. It would be nice if clang-tidy supported this option just like clang.
**Example:**
```cpp
int main() {}
```
`$ clang-tidy --extra-arg=-fdiagnostics-print-source-range-info test.cpp`:
```
test.cpp:1:5: warning: use a trailing return type for this function [modernize-use-trailing-return-type]
int main()
~~~ ^
auto -> int
```
The output is identical when `--extra-arg-before=` is used.
**Expected output:**
```
test.cpp:1:5:{1:1-1:3}: warning: use a trailing return type for this function [modernize-use-trailing-return-type]
int main()
~~~ ^
auto -> int
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzVVE1vnDAQ_TVwGRmxGPbjwCHpbqXeK_Vs8ABOvTbyRzbpr-8YNk2yqtJciwx47Jnn5zdjd1Y-tz8mpRFUAOVhtt6rjsxgYRbeg5BSBWWN0NDb80yeDgYtRg8XFSbItiVj-BScYMKNGT_SAAgjbyZYh4N1uM5n1ZcFW5lxcRukEqOxPqjes9kpE5i30fXInDAjMmUGm2ClRW-yahfAI54Tw0k8Iq0GOAzYhwK-BbjYqCV0CEb1tKkBek0gLCj5DD7Os3UBJYSJ9mrntDF4iD6AVj9xdS2y8piVd9dvldrpSZxnTeyv9jsP2s_S-nleR4g_nIUipvusOkC2u892xxvnW4SqfsvzvaKf0gcC-lAkDoTGb7mt5h8Xfreht6EXLsIZykPqRk9aAq2rdMqMwxCdgfA8I1DuVsmGaPpFtKy5P1uJFPwLGUWylzi2xrEUlzXHv0lyJbc7rY2wTuuQiJTT9WEZPwGFfaDb9wnBxjDHpXCVREMCUZleJjQflV_yJsbyr4meqY6oPlbc24T_U07KdepuWPrylPb_T-Jctlwe-EHkQQWN7fG1-NIWXss0WdcTBVlVfe4YV9Wb86bMCpdHp9sphNkvin-lNtLlEruCrhwytH58-RGwfaAckam8j-ip09TbhudT23QHHCrRiG6_3dabqhRyvy1lvel5ve2aOteiQ-1bEpZ4GLzAAkF9UjFXbVVWVcl5udnX-7opNs3ABykPdd_IHS95VpdICusi8SisG3PXLpS6OHqa1MoH_zqZLrjRIC7LET4pP1nXdgPNLeu2C-_f4hu0pA">