<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/108878>108878</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Deprecated warning is emitted twice
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
aelovikov-intel
</td>
</tr>
</table>
<pre>
For
```
template <typename T>
struct ptr {};
struct sub_group {
template <typename T>
[[deprecated("use new interface")]]
auto load(T *) {}
};
auto foo(sub_group sg, int *p) { return sg.load(p); }
```
the warning is emitted twice (https://godbolt.org/z/PbzPMfhh5):
```
<source>:10:44: warning: 'load' is deprecated: use new interface [-Wdeprecated-declarations]
10 | auto foo(sub_group sg, int *p) { return sg.load(p); }
| ^
<source>:7:10: note: 'load' has been explicitly marked deprecated here
7 | auto load(T *) {}
| ^
<source>:10:44: warning: 'load<int>' is deprecated: use new interface [-Wdeprecated-declarations]
10 | auto foo(sub_group sg, int *p) { return sg.load(p); }
| ^
<source>:6:7: note: 'load<int>' has been explicitly marked deprecated here
6 | [[deprecated("use new interface")]]
| ^
2 warnings generated.
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzcVMtu6zYQ_ZrRhrBBDa2HF1rIdrQrkEWALgtKGktsaFEgKafJ1xdU5Nh10qZo7-oaBCxhyDPnIY50TnUDUQHJDpJDJCffG1tI0uasns15pQZPOqpN-1pUxgI_AC8h5cuaXz2dRi09MRB7_zrSIE_EnkA8vJedt1Pj2egtg2wH2QHEbsG5rbup_q2zZhrnXXOFMca-AWcz711Lo6VGemoBc0CcHLGBXlhgb4-yIUAE3EJyCOsDXE7eMG1kOPXEAEvA7YXkO8NPbOcjR2MA8ytj1wHuQ7OAMS4gzJKf7MBct15ahAqIHbvC_9XIxc6e2Iu0gxo6phyjk_KeWuZfVEMMMO-9Hx2IErACrDrT1kb7tbEdYPUGWD3Wb4-_HPs-mbuVX3cSe2cm21AwUpQxB1FuNiDKS-fwCJi9E88CjxuLRck-GRyCWP163bRqqdHSSq_M4G5NjzmDbM9-qI9s_gVYSB6-VJhdVLLBeLpT10vHaqKB0R-jVo3y-pWdpH2m9kY168nStV02t_tXH9H37P7Zf7FXgw8bf4Yg0iWMTzncqvwvgaQfgfyvkXDHHi-BONbRQDbgre-uVNQWot2KrYyoiDNMkzjPRBz1xTHFtM4z5A3fUtLUNVHaNsk2ldTKBrNIFchxw7dxilxgHK_bo4iRNsg5J8nzFjacTlLptdbnU7jjkXJuoiLmeZ7lkZY1aTfPbsRZXKgGYckhskU4tKqnzsGGa-W8u8J45TUVh6uZfzdxosnq4m7kKN9P9boxJ8AqIC5_q9Ga36nxgNXMwwFWC9FzgX8GAAD__xRg4Bg">