<div dir="ltr">I actually undid the effect of [1] last Thursday in r249704, so one way to solve your problem is to build a fresh clang-cl or wait until Hans puts together a weekly build.<br><br>If you're only interested in static analyzer results, and you want to stick with clang 3.7, you may be able to convince clang that it doesn't need to emit code in order to bypass the assertions by adding -fsyntax-only to the command line.<div><br></div><div>If you need clang 3.7 with code generation and static analyzer results, I think you're out of luck.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 12, 2015 at 7:02 AM, Nikolai Kosjar <span dir="ltr"><<a href="mailto:nikolai.kosjar@theqtcompany.com" target="_blank">nikolai.kosjar@theqtcompany.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi!<br>
<br>
As already observed in [1], things changed with regard to exceptions.<br>
<br>
However, this also seems to break the clang static analyzer use case, which worked fine before. Is there a workaround for the *analyzer* case for 3.7.x? No actual code generation or catching of exceptions should be needed for this one.<br>
<br>
<br>
Details:<br>
<br>
--8<----main.cpp----------<br>
#include <iostream><br>
<br>
int main()<br>
{<br>
try {<br>
throw 1;<br>
} catch (int) {<br>
return 1;<br>
}<br>
<br>
return 0;<br>
}<br>
--8<----------------------<br>
<br>
This works fine with 3.6.1:<br>
<br>
$ llvm-3.6.1\bin\clang-cl.exe --analyze /EHcs main.cpp<br>
<br>
It stopped working with 3.7.0:<br>
<br>
$ llvm-3.7.0_64\bin\clang-cl.exe --analyze /EHcs main.cpp<br>
main.cpp(6,5) : error: cannot use 'throw' with exceptions disabled<br>
throw 1;<br>
^<br>
main.cpp(5,3) : error: cannot use 'try' with exceptions disabled<br>
try {<br>
^<br>
2 errors generated.<br>
<br>
Same results without the "/EHcs" flag. In [1] the following flags are suggested:<br>
<br>
-Xclang -fexceptions -Xclang -fcxx-exceptions -Xclang -fnew-ms-eh<br>
<br>
However, 3.7.0 does not know '-fnew-ms-eh' and will crash with the remaining options.<br>
<br>
Nikolai<br>
<br>
<br>
[1] <a href="https://groups.google.com/forum/#!topic/llvm-dev/WPn8uSpgCis" rel="noreferrer" target="_blank">https://groups.google.com/forum/#!topic/llvm-dev/WPn8uSpgCis</a><br>
</blockquote></div><br></div>