http://d.puremagic.com/issues/show_bug.cgi?id=10121
Summary: Declarations before first case level in switch
statement are allowed
Product: D
Version: unspecified
Platform: All
OS/Version: All
Status: NEW
Keywords: accepts-invalid, wrong-code
Severity: normal
Priority: P2
Component: DMD
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from Maxim Fomin <[email protected]> 2013-05-19 12:32:41 PDT
---
extern(C) int printf(const char*, ...);
void main()
{
switch(0)
{
int a = 4; // if immutable, prints 4
case 0:
printf("%d\n", a); //prints 0
}
}
After the switch there is jump to zero case without proper initialization of
'a'.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------