<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/81046>81046</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[FMV] -Wunused-function incorrectly complains about versioned static functions
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
jroelofs
</td>
</tr>
</table>
<pre>
https://clang.godbolt.org/z/7zdKf8M9r
```
__attribute__((target_version("fp16")))
static int foo(void) { return 1; }
__attribute__((target_version("fp16fml")))
static int foo(void) { return 2; }
__attribute__((target_version("default")))
static int foo(void) { return 0; }
int caller() {
return foo();
}
```
`-Wunused-function -Werror`
```
<source>:2:12: error: unused function 'foo' [-Werror,-Wunused-function]
2 | static int foo(void) { return 1; }
| ^~~
<source>:5:12: error: unused function 'foo' [-Werror,-Wunused-function]
5 | static int foo(void) { return 2; }
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0VEtvozAQ_jXDxUpkxoDhwCFpymXV6_YYGWOIKwdHfnTVHvrbVxDS92EbaZFlhMffw2ZmhPd6GJWqId9CvktEDAfr6gdnlbG9T1rbPdWHEE4e2AawAWykEeOwHmzXWhPW1g2AzTNgw5-7X315VzmgO6CbZS7oMubP_V6E4HQbg9rvAUvAMgg3qLB_VM5rO85r2J_SAhABq2XMYB9E0JLoMZDeWsDy0eoOsCLAt8SpEN1IUmBbAnz33sMPRPujuU4Xr9ftVC-iCdfp0m90J4AUxig3C8z7zxFCyAV4Zpy02BJ8Y_n4z14XV_dxjF51qz6OMmg7ktW9cs66r1s_4NmNt9FJBewW2AaBbdJpImcs25AzLXmlBeSzPU4g31408OaLPuS7t3MhAX5Dfp4jM-zdA_nty8u3zvP_5Dz_Z-f4yfnlopOuZl3FKpGoOuWUsyxjZZEcaqoq5FyKVAqV85YWaZ5i13PeYykqVSa6RooZRcoR0yor1lj1mZSqYoWQJXYdZFQdhTZrYx6PU7Un2vuo6jKlWZEY0Srj5-aBOKo_ZA5OqZzvEldPmFUbBw8ZNdoH_8YSdDBz12nufkO-I1-TS4_SOqdkME9E2uPJCD16IlobA1kKSHWXa7ugfBKd-dSwBh0OsV1LewRsJgPLa3Vy9kHJANjMtj1gMx_rbwAAAP__i1iAIw">