DMD crashes when compiling the following code:
```
extern(C++):
struct S(bool defined)
{
enum DefinedType { Defined }
}
void f(T)(S!(true).DefinedType = S!(true).DefinedType.Defined)
{
}
void main()
{
f!(int)();
}
```
A gdb backtrace repeats the following three lines:
```
#50 0x0000555555952ab7 in CppMangleVisitor::visit(TemplateInstance*) (this=0x7fffffffb848, t=0x7ffff789a8a0) at src/dmd/cppmangle.d:2095
#51 0x00005555559d6f8e in TemplateInstance::accept(Visitor*) (this=0x7ffff789a8a0, v=0x7fffffffb848) at src/dmd/dtemplate.d:5496
#52 0x0000555555951b67 in _D3dmd9cppmangle16CppMangleVisitor14writeQualifiedMFCQBz9dtemplate16TemplateInstanceMDFZvZv (this=0x7fffffffb848, dg=..., t=0x7ffff789a8a0) at src/dmd/cppmangle.d:1671
```
According to run.dlang.org it compiled until 2.083.1 and DMD crashes since 2.084.1, but I did not check if the mangling was correct, when it compiled.
Comment #1 by robert.schadek — 2024-12-13T19:35:13Z