<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/57992>57992</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Multiplication of `std::complex<__float128>` causes ambiguous call to `copysign`
</td>
</tr>
<tr>
<th>Labels</th>
<td>
libc++
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
kparzysz-quic
</td>
</tr>
</table>
<pre>
```
#include <complex>
using complex128 = std::complex<__float128>;
complex128 mul(complex128 x, complex128 y) {
return x*y;
}
```
```
$ clang++ -c cs.cc -stdlib=libc++
/local/mnt/w/c/org/bin/../include/c++/v1/complex:604:19: error: call to 'copysign' is ambiguous
__a = copysign(__libcpp_isinf_or_builtin(__a) ? _Tp(1) : _Tp(0), __a);
^~~~~~~~
cs.cc:6:11: note: in instantiation of function template specialization 'std::operator*<__float128>' requested here
return x*y;
^
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:196:14: note: candidate function
__MATHCALLX (copysign,, (_Mdouble_ __x, _Mdouble_ __y), (__const__));
^
[...snip many similar lines...]
12 errors generated.
```
This compiles without errors with libstdc++, so I'm guessing it's something to do with libc++.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyFVE2TmzgQ_TXiojIFwnwdOHg8ce1WZW5z2BslhIyVCET0kYzn129LYJtJsllKNJJaeuj161an-muDimRtyTNKDohkYmLS9Ryj7MjUOEv-hrJPqzdYZ8Q04NWXkgpWPmNje5QdoN33HNv2LBW1sMIDZE9bjM3u0UlEqs3EGyLHLfwVkRqjct2PsebW6ckvO1wfsOXz2vmJ0G8nyR4zSacBkSdoeMcwMzFjGO-AhxQdMALLFvcHIHKSilE48WmcLNgf8MK6k9IAdurEBDaOwaxhXNwBhpy-p354C9ChSPZg0xoM5lor7TsALrFVGJGSqflqxACQJRYG07ETg1PO3ALxeNqWBhUeO6q29QzmuRUg17lVuu2ckFYsPhpimp1w-zrDRLoMD-swgaEXYVl3jzH-5UH5J1T-ri0i-5h6np5l6uEnZbn_igmasXSyglqhJqzO-OwmFvqWQ4Co5djMnAkqxfuyBsJwzzI1c00tRIwcfsk0iJbm3xw3lvf4wjX_Y-J8JHMT2Rn9QcO3qmiL_U6Kyb3thskFra3xaUDtxWtm4ksQM5Ddb8kyOvWi94RuFJfftO3L4fWv4-Hz539wqICbdkcfey_TS69cJ3kLQoSi2E5cV42CnExBNNs2TP2HXg92-VMcx2YSMx7pdMVGjEJSjYEbN-BB-fM241Oy5KbBA5980Hkf_6HSXi-QqT7FheQG_xD2opy9Ifgh_KcDGe9FccRG4b9BtBEPoFm4W4T1WoNj5PbiJ6AeenXfvu5djxHxJi2KPQFTZlHfZH2d1TSywkrevDhI-VkKdk8zOO__3lVFAqI5wzc196jLIrkrVSSR07K5WDsbj0hO0AY4petiwPaXhfx---xmrb5w5i8NYQxQhU5e1jWJLk1JuzTt6ySjVV7mVZry_FzXRZoTVrG6IJGkHZemAe0QIZuriRCQKxINSQhJalKkFdlnWZwleZ0VBSsSmnQlrdA-4SMVMvYHieGuinQTztS5wYBTCmPNw0mNp8d5-B_gUwcy6ubrTPX71bzvvjnBokCiCQz-BY-c12c">