Just ran into this today. Removing the pull description because even though the PR was pulled, this is not fixed, not sure what happened.
Comment #3 by schveiguy — 2019-11-23T02:42:09Z
I'll note this is important to fix, as vibe.d is a showcase project of D, and diet templates use #line to help diagnose issues with diet templates.
Comment #4 by bugzilla — 2020-08-09T10:03:14Z
This is apparently caused by the code in e2ir.d:
elem *buildArrayBoundsError(IRState *irs, const ref Loc loc)
{
if (irs.params.checkAction == CHECKACTION.C)
{
return callCAssert(irs, loc, null, null, "array overflow");
}
if (irs.params.checkAction == CHECKACTION.halt)
{
return genHalt(loc);
}
auto eassert = el_var(getRtlsym(RTLSYM_DARRAYP));
auto efile = toEfilenamePtr(cast(Module)irs.blx._module); ***
auto eline = el_long(TYint, loc.linnum);
return el_bin(OPcall, TYvoid, eassert, el_param(eline, efile));
}
Note that it gets the filename from _module rather than loc. I believe it is this way to stop the redundant generation of filename strings into the object file. The previous function filelineFunction() gets it fro the loc.
Comment #5 by dlang-bot — 2020-09-16T09:35:26Z
@WalterBright created dlang/dmd pull request #11741 "fix Issue 11049 - array bounds error uses module file name rather tha…" fixing this issue:
- fix Issue 11049 - array bounds error uses module file name rather than file name modified by #line directive
https://github.com/dlang/dmd/pull/11741
Comment #6 by dlang-bot — 2020-09-23T02:17:28Z
dlang/dmd pull request #11741 "fix Issue 11049 - array bounds error uses module file name rather tha…" was merged into master:
- 26d0f3557d125b2ec43ead7b61e08d855fc12751 by Walter Bright:
fix Issue 11049 - array bounds error uses module file name rather than file name modified by #line directive
https://github.com/dlang/dmd/pull/11741