[Issue 21952] New: ice on noreturn used as template parameter

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun May 23 03:07:59 UTC 2021


https://issues.dlang.org/show_bug.cgi?id=21952

          Issue ID: 21952
           Summary: ice on noreturn used as template parameter
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Keywords: ice
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: b2.temp at gmx.com

this triggers a dmd assert:

---
alias noreturn = typeof(*null);

template T(A)
{
    A a;
}

void main()
{
    alias Tnr = T!noreturn;
}     
---

output:

---
ERROR: This is a compiler bug.
Please report it via https://issues.dlang.org/enter_bug.cgi
with, preferably, a reduced, reproducible example and the information below.
DustMite (https://github.com/CyberShadow/DustMite/wiki) can help with the
reduction.
---
DMD v2.097.0-beta.1-42-g9d718f2f8
predefs   single_module runnable_module run_single_module DigitalMars
LittleEndian D_Version2 all D_SIMD Posix ELFv1 linux CRuntime_Glibc
CppRuntime_Gcc D_InlineAsm_X86_64 X86_64 D_LP64 D_PIC assert D_ModuleInfo
D_Exceptions D_TypeInfo D_HardFloat
binary    /home/basile/dev/repos/dlang/dmd/generated/linux/release/64/dmd
version   v2.097.0-beta.1-42-g9d718f2f8
config    /home/basile/dev/repos/dlang/dmd/generated/linux/release/64/dmd.conf
DFLAGS   
-I/home/basile/dev/repos/dlang/dmd/generated/linux/release/64/../../../../../druntime/import
-I/home/basile/dev/repos/dlang/dmd/generated/linux/release/64/../../../../../phobos
-L-L/home/basile/dev/repos/dlang/dmd/generated/linux/release/64/../../../../../phobos/generated/linux/release/64
-L--export-dynamic -fPIC
---
core.exception.AssertError at src/dmd/toobj.d(603): Assertion failure
----------------
??:? _d_assertp [0x8e5b55]
src/dmd/toobj.d:603 _ZN9toObjFile9ToObjFile5visitEP14VarDeclaration [0x7e71e8]
src/dmd/declaration.d:1642 _ZN14VarDeclaration6acceptEP7Visitor [0x618fe5]
src/dmd/toobj.d:848 void dmd.toobj.toObjFile(dmd.dsymbol.Dsymbol,
bool).ToObjFile.visit(dmd.dtemplate.TemplateInstance).__lambda2!(dmd.dsymbol.Dsymbol).__lambda2(dmd.dsymbol.Dsymbol)
[0x7e7a89]
src/dmd/dsymbol.d:103 void
dmd.dsymbol.foreachDsymbol(dmd.root.array.Array!(dmd.dsymbol.Dsymbol).Array*,
void delegate(dmd.dsymbol.Dsymbol)) [0x6541a7]
src/dmd/toobj.d:848 _ZN9toObjFile9ToObjFile5visitEP16TemplateInstance
[0x7e7a64]
src/dmd/dtemplate.d:7504 _ZN16TemplateInstance6acceptEP7Visitor [0x68291d]
src/dmd/toobj.d:1029 _Z9toObjFileP7Dsymbolb [0x7e6786]
src/dmd/glue.d:429 _Z10genObjFileP6Moduleb [0x7d02d1]
src/dmd/mars.d:627 int dmd.mars.tryMain(ulong, const(char)**, ref
dmd.globals.Param) [0x5c8073]
src/dmd/mars.d:1070 _Dmain [0x5c9869]

--


More information about the Digitalmars-d-bugs mailing list