<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/128361>128361</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Clang] -Wpsabi complains too eagerly
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang:diagnostics
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
philnik777
</td>
</tr>
</table>
<pre>
Clang currently complains when calling a function that the ABI changes if a feature is enabled, but ignores that the function is marked `[[gnu::always_inline]]`, which ensures that the type will never be part of the ABI. e.g.
```c++
using vec [[gnu::vector_size(32)]] = int;
[[gnu::always_inline]] vec test() {
return {};
}
void call() {
(void)test(); // complains that test() changes the ABI with avx enabled
}
```
Ironically, it doesn't complain if the address is taken, which is one of the few cases where this would actually matter, since LLVM might not be able to inline a call to the function pointer.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyEk0GvozgMxz9NuFivAgOlHDi0U1Uaafa6exyF4IL3pQlKTLvdT78KfX2deZeVLCEg_vkf_20dI4-OqFP1QdXHTC8y-dDNE1vH703TZL0f7t03q90IZgmBnNg7GH-ZrWYX4TaRA6OtZTeChvPijLB3IJMWkIlgf_gOZtJupAh8TkdIyxIIOAI53VsaFH6DfhHg0flA8ZX7SeMIFx3eaQC1zVeph9Etqtyrcq_tTd_jT3aWHan6mGKbJ-ZtYjMBubj8RpX7THBja8HRlQL0BLMOAv78FLwB2owble8TaA2j8JAi3y8x3fRKBr7ouJIRH35G_pcU7kpU2D7UgCqPwE5UmfJT_O8FVr5QFIU7hS2oJqUCBJIluPW1OX7wmuODevU8rE58yVG4S78Uti-gKg-g8KTw9IuVjwa9ij5de7p4Y5lAX__5tO2z-LNLDyHfg3echNyTCSwweIpOYSOfxdIkJKwehkAxJn9Fv5N7ucYRvKOnJ2e6gdGR1nkLBDJxhJtf7ADayJJqwUWLUEiEyM4Q_Pjx5x9w4XEScF6Sy0k1iIdHp0Gv3Uoffpu12bMTCpts6MqhLVudUVc0VY5VUWOVTV1e12S2fVXTUKDBoujLVg-6QdOf22rQGXeYY50jYrHFGqvNrqA6L3TdtLvtDodcVTldNNuNtdfLxocx4xgX6grcldsis7onG9eVRDRp9VS5H1iPzkdhExVi2tXQpfS3fhmjqnLLUeILKCx23ep1ddNIvf01R93zr4Z7D6RHCvaeLcF2k8gc00yukzGyTEu_Mf6i8JS4H4-3Ofi_yYjC06o6Kjx9CL92-F8AAAD__20UX-Y">