www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22933] New: importC: goto skips declaration of variable

https://issues.dlang.org/show_bug.cgi?id=22933

          Issue ID: 22933
           Summary: importC: goto skips declaration of variable
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: ImportC, rejects-valid
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: duser neet.fi
                CC: duser neet.fi

void fn()
{ 
        goto L;
        int x = 1;
        L:
        return;
}

Error: `goto` skips declaration of variable `test.fn.x` at test.c(4)

could this be allowed in importC? other compilers accept it when compiling C
but not C++

--
Mar 25 2022