http://d.puremagic.com/issues/show_bug.cgi?id=7630
Summary: declaration in switch scope not initialized + CTFE error Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: d...@dawgfoto.de --- Comment #0 from d...@dawgfoto.de 2012-03-02 09:47:15 PST --- int foo(int a) { switch (a) { int res; case 1: res = 1; return res; case 2: return res; default: return 0; } } void main() { enum v1 = foo(1); // CTFE error, v->addrOnStack not set enum v2 = foo(2); // CTFE error, used before initialization assert(foo(2) == 0); // runtime error, res is uninitialized } -------- -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------