Custom Tool Against Exception Code

I have a custom tool that I wrote that has a command-line like:
Tool.exe file.cpp – --driver-mode=cl -fms-compatibility-version=19 -I(Some include directories) -D(Some macros)

I have a line in the code I am running my tool against that throws an exception. The tool gives an error “cannot use ‘throw’ with exceptions disables”.

As near as I can tell I am not disabling exceptions. Is there something that I have to do to enable exceptions and RTTI?

Passing /EHsc should do it, just like you would enable them with cl.exe. The default setting is /EHs-, which is off.

Our treatment of /EHsc is slightly different from MSVC. For MSVC, it really controls whether C++ destructors are run on exception, and they emit a warning whenever you use throw or catch without it. For Clang, it disables everything, throw, catch, destructors, whatever.

We didn’t feel it was worth supporting a mode where ‘throw’ and ‘catch’ work, but destructors don’t run. It might make sense to have a mode where we downgrade the error to a warning and compile catch to nothing, though.