[Issue 22917] New: compiler crash: template struct wrapped in template struct wrapper in lambda wrapped in traits(compiles)
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Mar 24 12:06:11 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=22917
Issue ID: 22917
Summary: compiler crash: template struct wrapped in template
struct wrapper in lambda wrapped in traits(compiles)
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: default_357-line at yahoo.de
```
struct Inner()
{
bool opEquals(Inner) { }
}
struct Outer()
{
Inner!() field;
bool opEquals(Outer) { return field == field; }
}
void main()
{
void nested()() { cast(void) Outer!()(); }
static assert(__traits(compiles, nested()) == false);
nested();
}
```
=>
[] error: __error
---
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.099.0-217-g1c609085a
predefs 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_PreConditions D_PostConditions D_ModuleInfo D_Exceptions D_TypeInfo
D_HardFloat
binary dlang/dmd/generated/linux/release/64/dmd
version v2.099.0-217-g1c609085a
config dlang/dmd/generated/linux/release/64/dmd.conf
DFLAGS -Idlang/dmd/generated/linux/release/64/../../../../../druntime/import
-Idlang/dmd/generated/linux/release/64/../../../../../phobos
-L-Ldlang/dmd/generated/linux/release/64/../../../../../phobos/generated/linux/release/64
-L--export-dynamic -fPIC
---
core.exception.AssertError at src/dmd/e2ir.d(529): Assertion failure
----------------
??:? _d_assertp [0x55e5455648bd]
src/dmd/e2ir.d:529 _ZN13ToElemVisitor5visitEP10Expression [0x55e545415899]
src/dmd/visitor.d:66 _ZN7Visitor5visitEP8ErrorExp [0x55e545406006]
src/dmd/expression.d:2026 _ZN8ErrorExp6acceptEP7Visitor [0x55e54532197d]
src/dmd/e2ir.d:504 _Z6toElemP10ExpressionP7IRState [0x55e5454157d3]
src/dmd/e2ir.d:411 _Z10toElemDtorP10ExpressionP7IRState [0x55e54541541c]
src/dmd/s2ir.d:728 _ZN11S2irVisitor5visitEP15ReturnStatement [0x55e545440ee3]
src/dmd/statement.d:1430 _ZN15ReturnStatement6acceptEP7Visitor [0x55e5453d51b1]
src/dmd/s2ir.d:1537
_ZN11S2irVisitor14Statement_toIREP9StatementP7IRStateP9StmtStateI5blockE
[0x55e5454431c3]
src/dmd/s2ir.d:786 _ZN11S2irVisitor5visitEP17CompoundStatement [0x55e545441127]
src/dmd/statement.d:620 _ZN17CompoundStatement6acceptEP7Visitor
[0x55e5453d3815]
src/dmd/s2ir.d:1557 _Z14Statement_toIRP9StatementP7IRState [0x55e5454432bf]
src/dmd/glue.d:1100 _Z25FuncDeclaration_toObjFileP15FuncDeclarationb
[0x55e545438430]
src/dmd/toobj.d:311 _ZN9toObjFile9ToObjFile5visitEP15FuncDeclaration
[0x55e54544da64]
src/dmd/func.d:2817 _ZN15FuncDeclaration6acceptEP7Visitor [0x55e545360cdd]
src/dmd/toobj.d:534 void dmd.toobj.toObjFile(dmd.dsymbol.Dsymbol,
bool).ToObjFile.visit(dmd.dstruct.StructDeclaration).__lambda2!(dmd.dsymbol.Dsymbol).__lambda2(dmd.dsymbol.Dsymbol)
[0x55e54544e251]
src/dmd/dsymbol.d:105 void
dmd.dsymbol.foreachDsymbol(dmd.root.array.Array!(dmd.dsymbol.Dsymbol).Array*,
void delegate(dmd.dsymbol.Dsymbol)) [0x55e5452de39f]
src/dmd/toobj.d:534 _ZN9toObjFile9ToObjFile5visitEP17StructDeclaration
[0x55e54544e19e]
src/dmd/dstruct.d:451 _ZN17StructDeclaration6acceptEP7Visitor [0x55e5452ddc6d]
src/dmd/toobj.d:827 void dmd.toobj.toObjFile(dmd.dsymbol.Dsymbol,
bool).ToObjFile.visit(dmd.dtemplate.TemplateInstance).__lambda2!(dmd.dsymbol.Dsymbol).__lambda2(dmd.dsymbol.Dsymbol)
[0x55e54544eb35]
src/dmd/dsymbol.d:105 void
dmd.dsymbol.foreachDsymbol(dmd.root.array.Array!(dmd.dsymbol.Dsymbol).Array*,
void delegate(dmd.dsymbol.Dsymbol)) [0x55e5452de39f]
src/dmd/toobj.d:827 _ZN9toObjFile9ToObjFile5visitEP16TemplateInstance
[0x55e54544eb0e]
src/dmd/dtemplate.d:7504 _ZN16TemplateInstance6acceptEP7Visitor
[0x55e54530bcd1]
src/dmd/toobj.d:1008 _Z9toObjFileP7Dsymbolb [0x55e54544d9ca]
src/dmd/glue.d:522 _Z10genObjFileP6Moduleb [0x55e5454369d3]
src/dmd/glue.d:120 void dmd.glue.generateCodeAndWrite(dmd.dmodule.Module[],
const(char)*[], const(char)[], const(char)[], bool, bool, bool, bool, bool)
[0x55e54543521a]
src/dmd/mars.d:571 int dmd.mars.tryMain(ulong, const(char)**, ref
dmd.globals.Param) [0x55e5452502a5]
src/dmd/mars.d:953 _Dmain [0x55e545251851]
--
More information about the Digitalmars-d-bugs
mailing list