www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19269] New: Cannot throw C++ exceptions from D


          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 puremagic.com
          Reporter: pro.mathias.lang 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

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

Sep 26 2018