On Thu, 17 Oct 2024 at 15:51, David Aldrich via Gcc-help < gcc-help@xxxxxxxxxxx> wrote: > Hi > > I have code that compiles correctly with gcc 12 and gcc 14, but not with > gcc 13: > > SIMD.h: In static member function ‘static std::complex<_Float16> > SIMD::reduce_add_pch(const __m256h&)’: > /SIMD.h:893:44: error: no matching function for call to > ‘std::complex<_Float16>::complex(float&, float&)’ > 893 | return std::complex<_Float16>(re,im); > | ^ > > We are using C++20. > > I know that the behaviour of _Float16 changed in gcc 13 but I don't > know how to fix this error. > > Any suggestions please? > There's no implicit conversion from float to the narrowing _Float16, but it shoudl work with explicit casts: return std::complex<_Float16>(static_cast<_Float16>(re), static_cast<_Float16>(im));