Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: template mir.math.common.copysign cannot deduce function from argument types !()(int, real), candidates are: #336

Open
InnotSagg opened this issue Mar 28, 2021 · 0 comments

Comments

@InnotSagg
Copy link

InnotSagg commented Mar 28, 2021

I try cross build from linux for -mtriple=x86_64-w64-mingw32, get this error:

mir-algorithm/source/mir/format_impl.d(19): Error: template mir.math.common.copysign cannot deduce function from argument types !()(int, real), candidates are:
mir-core/source/mir/math/common.d(201):        copysign(T)(in T mag, in T sgn)
mir-algorithm/source/mir/format_impl.d(108): Error: template instance mir.format_impl.printFloatingPointGen!real error instantiating
 ldc2 -v -mtriple=x86_64-w64-mingw32
binary    /usr/local/bin/ldc2
version   1.25.1 (DMD v2.095.1, LLVM 11.0.1)
config    /usr/local/etc/ldc2.conf (x86_64-w64-windows-gnu)
Error: No source files

add cast(double) to the code like this:

    bool neg = copysign(1, cast(double)c) < 0;

get this error:

Intrinsic has incorrect argument type!
x86_fp80 (x86_fp80*)* @llvm.fabs.f80
in function _D3mir11format_impl__T21printFloatingPointGenTeZQBaFNaNbNiNeeKxSQCk6format10FormatSpecKG512aZm
LLVM ERROR: Broken function found, compilation aborted!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant