<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/95748>95748</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang] Aliasing inline log1pf causes compilation failure
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
fpallaresintel
</td>
</tr>
</table>
<pre>
Clang throws an error when compiling the following C code. Changing the `log1pf` function name to something else will make this compile, as well as removing `inline` or `__attribute__((always_inline))` from the definition. This code compiles with GCC.
https://godbolt.org/z/oqPeqsva6
```
float log1pf(float);
inline float __attribute__((always_inline)) log1pf(float x) {
return x;
}
float foo(float) __attribute__((alias("log1pf")));
```
Output:
```
<source>:7:33: error: alias must point to a defined variable or function
7 | float foo(float) __attribute__((alias("log1pf")));
| ^
<source>:7:33: note: the function or variable specified in an alias must refer to its mangled name
<source>:7:33: note: function by that name is mangled as "log1pf"
7 | float foo(float) __attribute__((alias("log1pf")));
| ^~~~~~~~~~~~~~~
| alias("log1pf")
1 error generated.
Compiler returned: 1
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8VE1zmzAQ_TXishOPEJ8-cHBw3GN76N0jYAG1QiKSsJMe-ts7Alw7nnSaQ6cMY5C12vfesvu4taJTiAVJHkmyD_jkem2KduRScoNWKIcyqHTzWpSSqw5cb_TZAleAxmgD5x4V1HoYhRTzNkKrpdRnvyqh1g1uoOy56i7bJKVSd-HYkpRCO6naCa1A8QHBabB6QNf7WJQW4SykhIF_R3C9sCsQElYCt3BGKf3T4KBP_ghJqVBSKPSptfHr45E7Z0Q1OTweCcsJy7k881d7XCPZ1t-eitHDTLDBVijhWW3g64La4AXawlm4Hj6V5YbQPaG73rnRkmhH2IGwQ6ebSku30aYj7PCDsIN-_oLP9sTTJZykdL3nZSs1d7DWg-Xz0vOJHtfw-XehCkvwxxTd5YQX_x_J1rQABt1kFLxckbL9LeRyqtX6htX70ILb-ZVdENla01sZb1V_ntw4OV-093ZJVFo9mRpJ9ESiXUaiXRSRaLd0nH-ZQWGYrINRC-V84_Dlu2EDJ24EryT6Drj010U2QAYkK-HfyoP58nlJ8vQXEUo79M95Ui7dr82VtR2xFq3ABoTyc3Yj1mCLxosVzsLAVSexmSfng5i_8apXcD13y9SJay5u4Y3S_1e1n2-u-4A_JZzDwtWKOlRouMNmncxymViz9jo2vgThXcsFTRE122jLAyzCLMzTMEzTOOiLpqY05m2esSQO2Za1VUXzbZrUeRzXUZYFomCUxTQNM5rTLI43aYwtYxWNeZRXbZSSmOLAhdxIeRq8IwTC2gmLbZLFeSB5hdLOvstY7b3Va0r2gSl8_EM1dZbEVArr7DWDE07OZr2cSPaw86Xx5reaxFIfqPlk8WKYfP7oLRdyMhhMRhZ3riVcP1WbWg-EHTzW-ngYjf6GtSPsMFO3hB0W9qeC_QoAAP__YIfsCw">