<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/56379>56379</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
std::source_location line number wrong when used as default argument value
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
IGR2014
</td>
</tr>
</table>
<pre>
Consider the following code snipet ([CompilerExplorer link](https://godbolt.org/z/3h3n5Moj6)):
```
#include<source_location>
#include<iostream>
void test_source_location(std::source_location src = std::source_location::current()) {
std::cout << "called at " << src.line() << "\n";
}
int main() {
test_source_location();
}
```
The output results for Clang, GCC and MSVC (left-to-right) are:
![image](https://user-images.githubusercontent.com/10415461/177286976-dd69339c-bd49-4f2a-9349-ae3bd1bdf2fd.png)
As you can see - both GCC and MSVC reports function INVOCATION line number, while Clang report function DECLARATION-one
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx1VF1vmzAU_TXkxSIiNp8PPKSkrSqtrdRNfa2MfQF3jh3Zpln363ch6ZJlbeSA8f0699wDrZXvdWONVxIcCQOQzmpt98r0RFgJxBu1g0AiWkbZVWO3O6XBXf_aaeswQCvzM8o2aB1C2PmIrSN6g6u3srU6LK3r8ek3_tnATHZvX_OIVtNCz2QTJesoT47r8EiZMkKPEiLWeDs6AS_aCh6UNRG7_sRJWR8c8O3JOl_frJIkgA8vl1lo6YOc6rP1hYl4J0jENuQrh8OhGJ0DEyZK5l5IVFwdihL8_Y0VdkTeWIML6aOCaw2S8IlL-nGOBZfIIRxynXlHWWOmGztmjorNeXfKBLLlynzEnQP4oumZ9P-yXbA_X3-gChD7DuE78KMOHkXhSKO5wWk25LZpCDeS3H9_nrCWGroQBxs71Q9hgsMdnOZLVygcteU9fCaU0YOLZ6tf9ioMYzudCGsCMrwUdos-qyRdZWm-mrZFQcu8KvJYyrxirBJxK9MqTjvK44rhjgNr5aqVHe3kcjcBrs57W3vybkciOA4bgMSktWH4tyMHO-umnkcjZlXcPTw_Nusfd48Pk96BmHHbgpuY2A_4NhyIOYadojbXzbf10xwWW5zwXH4hayYrVvFFUEFD_aUSzwqRvbOYfz-AIUgOSsgTCR3HwSDT_bhFpsgb1yMsRqfrixdx5vRIpNZvH7d45-wrCBzXjfJ-BI-bLGdFtRhqlne8TLOiKGmRQNGyMmWFoCCSIkuobBeat6B9jXNFiRrYkznFrNrNQtU0oTQpkiwpWZXlS1GUhWg5l5J3Fe14lCaA2tXLCcf0hVi4eobUjr1Ho1Y--JORe696AzCXw_x8DIN19d3tE01W6WIuXc_Q_wCSPHhU">