March 02, 2012 [Issue 7630] New: declaration in switch scope not initialized + CTFE error | ||||
---|---|---|---|---|
| ||||
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: nobody@puremagic.com ReportedBy: dawg@dawgfoto.de --- Comment #0 from dawg@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: ------- |
March 12, 2012 [Issue 7630] declaration in switch scope not initialized + CTFE error | ||||
---|---|---|---|---|
| ||||
Posted in reply to dawg@dawgfoto.de | http://d.puremagic.com/issues/show_bug.cgi?id=7630 dawg@dawgfoto.de changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |DUPLICATE --- Comment #1 from dawg@dawgfoto.de 2012-03-12 07:24:28 PDT --- *** This issue has been marked as a duplicate of issue 3820 *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation