www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13321] New: Wrong goto skips declaration error


          Issue ID: 13321
           Summary: Wrong goto skips declaration error
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Keywords: diagnostic, rejects-valid
          Severity: normal
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: bearophile_hugs eml.cc

Reduced from a post by nrgyzer:

struct Foo {
    this(int) {}
void main(string[] args) {
    Foo x;
    if (args.length > 1)
        goto EXIT;
    x = Foo(1);

2.067alpha gives an error message that I think is spurious (rejects-valid):

test.d(7,9): Error: goto skips declaration of variable test.main.__ctmp1 at

Aug 18 2014