Bug 15406 – [ICE] Accessing member of namespace embedded in a struct causes segfault

Status
RESOLVED
Resolution
WORKSFORME
Severity
major
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-12-05T00:14:10Z
Last change time
2020-03-21T03:56:33Z
Keywords
ice-on-invalid-code
Assigned to
No Owner
Creator
Meta

Comments

Comment #0 by monkeyworks12 — 2015-12-05T00:14:10Z
The following program causes the compiler to segfault. It compiles successfully if `Test.Name.Space.test` is not accessed. struct Test { extern(C++, Name.Space) { enum test = 0; } } void main() { assert(Test.Name.Space.test == 0); }
Comment #1 by petar.p.kirov — 2015-12-05T10:31:56Z
I think it segfaults because there's no concept of standalone enum values in C++ and the compiler does not now what to do. I would guess that you have hit some of the "Internal Compiler Error"s in https://github.com/D-Programming-Language/dmd/blob/master/src/cppmangle.d
Comment #2 by b2.temp — 2019-02-28T17:51:08Z
Just a regular error nowadays