Thread overview
[Issue 14482] [SPEC] Goto's into catch blocks should be an error
Apr 23, 2015
Iain Buclaw
Dec 17, 2022
Iain Buclaw
Feb 13, 2023
RazvanN
Feb 14, 2023
Iain Buclaw
April 23, 2015
https://issues.dlang.org/show_bug.cgi?id=14482

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |GDC, spec
                 CC|                            |ibuclaw@gdcproject.org

--
June 09, 2015
https://issues.dlang.org/show_bug.cgi?id=14482

Andrei Alexandrescu <andrei@erdani.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|D1 & D2                     |D2

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=14482

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P4

--
February 13, 2023
https://issues.dlang.org/show_bug.cgi?id=14482

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

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

--- Comment #1 from RazvanN <razvan.nitu1305@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.

--
February 14, 2023
https://issues.dlang.org/show_bug.cgi?id=14482

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---

--- Comment #2 from Iain Buclaw <ibuclaw@gdcproject.org> ---
Nope still a bug in DMD.

```
void test8()
{
  int a;
  goto L2;    // BOOM!  Jump into a forbidden EH region

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

--