<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/78694>78694</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
No valid source location attached to `trailing_return_without_auto` diagnostic for some cases
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang:frontend,
clang:diagnostics
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
hokein
</td>
</tr>
</table>
<pre>
Clang rejects the following invalid code (where we define a deduction guide inside a class), but there is no valid source location attached to the diagnostic of `function with trailing return type must specify return type 'auto', not 'void'`.
gcc gives a similar diagnostic, and it attaches to `B<int>`, which is better. See https://godbolt.org/z/c67Ef8e7x.
```
template <typename T>
struct B {
template <class U>
B(U) -> B<int>;
};
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMk0Fz6yYQxz_N6rITD0Iysg46xE587KV95wyCtUSLwAOruOmn7yC_NE5Pb8ZjpF3473-Xn3TObgpEA-yPsH-p9MpzTMMc_yIXqjHaj-HkdZgw0Z9kOCPPhJfofby5MKEL79o7iyZaQpCH20yJ8EZo6eICoUZLdjXsYsBpdZbQhVwWjcbrnEH2IE84rlyEE6HLGCLeRXNckyH00ehNQDNrM5NFjpsN6_QUYmZnMF4QlLis4V7q5nhGTtp5t1nnNQXkjyvhsmbGfCXjLh_fEiA7vXIE2RVDIXKJvEdnS0SJHYgXEM_3_8kYnNw7ZdSY3eK8Tg9mynkdLDr-dJyLY1DiCM3JBYbmFZQo226zM3PpeSRmSjv8nQhn5muG5hnkGeR5inaMnncxTSDP_4A8G9W9Xg7U_f3NU1G8_7ZXpuXqNRNCcyr9Bb0Q_lEqb-nMaTWMR4TueI8gPh7ZLgd__Lcf8Qjy8ANkj0_QvOJDJ81PAehevp4_zVR2aGzf9Lqioe7EXqmmPqhqHqwwprFCqm5vWyOVko20TbtXozL7zlLlBilkK-q6r-u6b9XO9LXQ_Ti29Sh012poBS3a-Z3370sZT-VyXmnoDqpvK69H8nmjWkpTCIbm-ZJiYAoWpAR5ekh8XV4uuf1LlYYi-zSuU4ZWeJc5fxVix56G336FU1Dik8O3O25vBc648tuGmxKPGF9iwhwXQqMz5WpNfvgfDY7nddyZuIA8Fz8_l6driuX7BHneppBBnrdB_BsAAP__9zw9YQ">