Bug 20703 – Segfault on missing import in template instantiation
Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-03-29T03:26:10Z
Last change time
2020-08-07T23:37:28Z
Keywords
ice
Assigned to
No Owner
Creator
moonlightsentinel
Comments
Comment #0 by moonlightsentinel — 2020-03-29T03:26:10Z
The following code causes a segfault in dmd (checked with current master):
==============================
// c.d:
import stdx.sorting;
const var = sort(string.init);
==============================
==============================
// stdx/sorting.d:
import stdx.traits : Unqual;
auto sort(Range)(Range r)
{
return Unqual!Range.init;
}
==============================
==============================
// stdx/traits.d:
template Unqual(T)
{
import CoreUnqual;
alias Unqual = CoreUnqual;
}
==============================
dmd c.d
stdx\traits.d(3): Error: module CoreUnqual is in file 'CoreUnqual.d' which cannot be read
import path[0] = C:\D\dmd2\windows\bin64\..\..\src\phobos
import path[1] = C:\D\dmd2\windows\bin64\..\..\src\druntime\import
stdx\traits.d(3): Error: module CoreUnqual is in file 'CoreUnqual.d' which cannot be read
import path[0] = C:\D\dmd2\windows\bin64\..\..\src\phobos
import path[1] = C:\D\dmd2\windows\bin64\..\..\src\druntime\import
stdx\traits.d(3): Error: module CoreUnqual is in file 'CoreUnqual.d' which cannot be read
import path[0] = C:\D\dmd2\windows\bin64\..\..\src\phobos
import path[1] = C:\D\dmd2\windows\bin64\..\..\src\druntime\import
Comment #1 by boris2.9 — 2020-03-29T07:23:31Z
Introduced by:
commit 17208b854a0ff67bbc05576ae72b966bbe1c60cb (refs/bisect/bad)
Author: Cristian Creteanu <[email protected]>
Date: Fri Dec 13 01:19:02 2019 +0200
Issue6592 - di header file created even if errors occur (#10635)
* Moved header file generation at the end
* Fix Issue 6592 - di header file created even if errors occur
Comment #2 by boris2.9 — 2020-08-07T23:37:28Z
*** This issue has been marked as a duplicate of issue 21091 ***