In the dmd.2.103.0-rc.1, the following code causes a link error when built with the -betterC compile option: ----------------- struct Data { Data[] range; string test; } Data[] foo() { Data[] ret; if (__ctfe) { Data tmp; tmp.range ~= Data.init; ret ~= tmp; } return ret; } void func(Data dat)() { } void bar(Data dat)() { if (dat.test.length) func!(dat.range[0])(); } extern (C) void main() { static immutable data = foo(); bar!(data[0])(); } ----------------- $ dmd -betterC main.d /usr/bin/ld: main.o: in function `main': main.d:(.text.main[main]+0x5): undefined reference to `_D4main__T3barVSQo4DataS2A1S2nnnZQxFNaNbNiNfZv' collect2: error: ld returned 1 exit status
@RazvanN7 created dlang/dmd pull request #15028 "Fix Issue 23799 - Link error with -betterC" fixing this issue: - Fix Issue 23799 - Link error with -betterC https://github.com/dlang/dmd/pull/15028
dlang/dmd pull request #15028 "Fix Issue 23799 - Link error with -betterC" was merged into stable: - 7c3e49b0d5ae05c668e198b47ff58721e3dd419e by RazvanN7: Fix Issue 23799 - Link error with -betterC https://github.com/dlang/dmd/pull/15028
dlang/dmd pull request #15066 "merge stable" was merged into master: - d46295483ac60dc01e8fac456e407eacda36c12f by Razvan Nitu: Fix Issue 23799 - Link error with -betterC (#15028) https://github.com/dlang/dmd/pull/15066