[Issue 19269] New: Cannot throw C++ exceptions from D

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Sep 26 18:06:46 UTC 2018


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

          Issue ID: 19269
           Summary: Cannot throw C++ exceptions from D
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: pro.mathias.lang at gmail.com

When trying to throw `core.stdcpp.exception : exception` from D (the
std::exception definition), DMD complains with: 
```
foo.d(2): Error: can only throw class objects derived from Throwable, not type
core.stdcpp.exception.std.exception
```

Code to reproduce:
```
import core.stdcpp.exception;
void main () { throw new exception(); }
```

--


More information about the Digitalmars-d-bugs mailing list