[Issue 14482] [SPEC] Goto's into catch blocks should be an error

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Feb 13 14:42:18 UTC 2023


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

RazvanN <razvan.nitu1305 at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |razvan.nitu1305 at gmail.com
         Resolution|---                         |FIXED

--- Comment #1 from RazvanN <razvan.nitu1305 at gmail.com> ---
This code:

void test8()
{
  int a;
  goto L2;    // Error: `goto` skips declaration of variable `test.test8.e` at
test.d(9)

  try {
      a += 2;
  }
  catch (Exception e) {
      a += 3;
L2: ;
      a += 100;
  }
  assert(a == 100);
}

fails to compiler, so I guess we can consider this fixed.

--


More information about the Digitalmars-d-bugs mailing list