[Issue 2215] New: Forward reference enum with base type within a struct causes Segmentation Fault in the compiler

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jul 10 11:32:23 PDT 2008


http://d.puremagic.com/issues/show_bug.cgi?id=2215

           Summary: Forward reference enum with base type within a struct
                    causes Segmentation Fault in the compiler
           Product: D
           Version: 2.016
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Keywords: ice-on-valid-code
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: schveiguy at yahoo.com


This code causes a dmd segmentation fault:

struct S
{
    E e;
}

enum E : int
{
    E1
}

replace int with ubyte, also fails.  I think this should be valid code because
moving e outside the struct or putting it in a class works (no errors, no
segfault).

The workaround is to declare the enum first.


-- 



More information about the Digitalmars-d-bugs mailing list