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

           Summary: typedef circular definition and ICE
           Product: D
           Version: D1
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: ibuc...@ubuntu.com


--- Comment #0 from Iain Buclaw <ibuc...@ubuntu.com> 2010-08-01 04:10:55 PDT ---
In DMD 1.049, this code used to work:

--
bug01a.d
----------
module bug01a;
import bug01b;
union any {}
typedef any ANY;

--
bug01b.d
-----------
module bug01b;
import bug01a;
struct circular_definition {
    union {
        ANY subany;
    }
}

Later (not sure when, but have tested on DMD 1.059) - this code began failing
with the message:

bug01a.d(4): Error: typedef bug01a.ANY circular definition


Now - this code fails and ICE's the compiler:

bug01a.d(4): Error: typedef bug01a.ANY circular definition
Segmentation fault


Other things to note about the bug, swapping the typedef and union declaration
in bug01a.d works

--
bug02a.d
----------
module bug02a;
import bug02b;
typedef any ANY;
union any {}


However, adding another struct in the second module triggers it again

--
bug02b.d
----------
module bug02b;
import bug02a;
struct circular_definition {
    union {
        ANY subany;
    }
}
struct triggers_bug {}


And ultimately, putting the import at the bottom means it compiles successfully
all the time.

--
works01a.d
----------
module works01a;
typedef any ANY;
union any {}
import works01b;


Regards

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to