title: Can try-catch blocks be compiled on LLVM / MSVC?
body: <p>I'm trying to change the compiler collection of a project which uses a lot of exceptions (try/catch blocks) from Microsoft Visual C++ to LLVM, but ran into compilation issues.</p>
  
  <p>Used tool chain:</p>
  
  <ul>
  <li>Visual Studio 2015 Enterprise (MSVC 14)</li>
  <li>LLVM 3.7 Windows/x64</li>
  </ul>
  
  <p>Here is some test source code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  int main()
  {
      try
      {
          throw 20;
      }
      catch (int e)
      {
          std::cout &lt;&lt; "An exception occurred. Exception Nr. " &lt;&lt; e &lt;&lt; '\n';
      }
      return 0;
  }
  </code></pre>
  
  <p>Compiling the code with the built-in Visual Studio compiler collection (v140), this are the command line results:</p>
  
  <pre><code>ClCompile:
    C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\CL.exe
        /c /ZI /nologo /W3 /WX- /sdl /Od /Oy- /D _MBCS /Gm /EHsc /RTC1 /MDd /GS /fp:precise
        /Zc:wchar_t /Zc:forScope /Zc:inline /Fo "Debug\\" /Fd"Debug\vc140.pdb" /Gd /TP
        /analyze- /errorReport:queue Main.cpp
    Main.cpp
  Link:
    C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\link.exe
        /ERRORREPORT:QUEUE /OUT:"C:\Users\jurocha\Desktop\ClangExcept\Debug\ClangExcept.exe"
        /INCREMENTAL /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib
        advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
        /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /Debug
        /PDB:"C:\Users\jurocha\Desktop\ClangExcept\Debug\ClangExcept.pdb" /TLBID:1
        /DYNAMICBASE /NXCOMPAT
        /IMPLIB:"C:\Users\jurocha\Desktop\ClangExcept\Debug\ClangExcept.lib"
        /MACHINE:X86 Debug\Main.obj
  </code></pre>
  
  <p>Compilation succeeds.</p>
  
  <p>Now, changing the compilers to LLVM (LLVM-vs2014):</p>
  
  <pre><code>ClCompile:
    C:\Program Files\LLVM\3.7\msbuild-bin\CL.exe
        /c /ZI /nologo /W3 /WX- /sdl /Od /Oy- /D _MBCS /Gm /EHsc /RTC1 /MDd /GS /fp:precise
        /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"Debug\\" /Fd"Debug\vc140.pdb" /Gd /TP
        /analyze- /errorReport:queue -m32 -fmsc-version=1900 Main.cpp
  clang-cl.exe : warning : argument unused during compilation: '/ZI' [ClangExcept.vcxproj]
  clang-cl.exe : warning : argument unused during compilation: '/Gm' [ClangExcept.vcxproj]
  clang-cl.exe : warning : argument unused during compilation: '/GS' [ClangExcept.vcxproj]
  Main.cpp(7,3): error : cannot use 'throw' with exceptions disabled [ClangExcept.vcxproj]
                    throw 20;
                    ^
  Main.cpp(5,2): error : cannot use 'try' with exceptions disabled [ClangExcept.vcxproj]
            try
            ^
    2 errors generated.
  </code></pre>
  
  <p>According to this document, <a href="http://clang.llvm.org/docs/MSVCCompatibility.html" rel="nofollow">http://clang.llvm.org/docs/MSVCCompatibility.html</a>:
  "Exceptions and SEH: Partial". But I can't make enough sense of it.</p>
  
  <p>Has anyone been able to achieve this?</p>