<p dir="ltr">Nick, did you ever put together a patch for this?</p>
<div class="gmail_quote">On Oct 10, 2015 11:46 AM, "Sergio Martins via cfe-dev" <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
Consider:<br>
if (foo() == bar())<br>
<br>
it's up to the compiler to decide if it calls foo() or bar() first, as the<br>
standard doesn't guarantee any order.<br>
<br>
Is there a way to force clang to evaluate first the rhs ?<br>
<br>
I want to compile Qt with "evaluate rhs first" and check that unit-tests still<br>
pass, then rebuild with "evaluate lhs first".<br>
<br>
Recenty we found some Qt code that relied on the order (undefined behavior)<br>
and it was discovered by compiling the code with MSVC2010, which evaluated the<br>
rhs first.<br>
<br>
<br>
Regards,<br>
Sérgio Martins<br>
<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div>