- edited description
Cannot compile unittest with @nogc attribute
~/d/unstandard-upstream (master) > dub test --compiler=dmd Generating test runner configuration 'test__library' for 'library' (library).
Building unstandard ~master configuration "test__library", build type unittest.
Compiling using dmd...
unstd/c/string.d(240): Error: @nogc function 'unstd.c.string.__unittestL233_11' cannot call non-@nogc function 'unstd.c.string.toCString!(malloc, char, char).toCString'
FAIL .dub/build/test__library-unittest-linux.posix-x86_64-dmd_2066-4E2D7AC88264C35BAE9EA64B0BEE0263/ test__library executable
Error executing command test:
dmd failed with exit code 1.
Occurs with dmd 2.066.1 / ldc 0.15.1 / gdc master.
This seems to resolved by removing the @nogc from the unittest.
Comments (4)
-
reporter -
repo owner toCString!malloc
is a@nogc
function and tests passes with 'HEAD' dmd/druntime/Phobos commits (except CTFE pointers bug is fixed so a workaround inunstd.array
asks to remove itself (I'll do it after compiler release)).Will test "2.066.1" soon.
-
repo owner OK,
onOutOfMemoryError
,onRangeError
and other functions aren't marked@nogc
in that release. Use GitHEAD
if you want to build unittests. -
repo owner - changed status to wontfix
Only Git HEAD is supported in unittests.
- Log in to comment