<div dir="ltr"><div>(Resending because I forgot to CC cfe-commits.)</div><div><br></div>On Fri, Jun 7, 2013 at 11:02 AM, Eli Friedman <span dir="ltr"><<a href="mailto:eli.friedman@gmail.com" target="_blank">eli.friedman@gmail.com</a>></span> wrote:<br>
<div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="im">On Sun, Jun 2, 2013 at 1:11 AM, David Majnemer <span dir="ltr"><<a href="mailto:david.majnemer@gmail.com" target="_blank">david.majnemer@gmail.com</a>></span> wrote:<br>
</div><div class="gmail_extra"><div class="gmail_quote"><div class="im">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Author: majnemer<br>
Date: Sun Jun  2 03:11:22 2013<br>
New Revision: 183084<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=183084&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=183084&view=rev</a><br>
Log:<br>
Properly consider the range of enum for range comparisons in C mode<br>
<br>
In some cases, clang applies the C++ rules for computing the range of a<br>
value when said value is an enum.<br>
<br>
Instead, apply C semantics when in C mode.<br><br></blockquote><div><br></div></div><div>With this patch, the following code triggers a -Wsign-conversion warning:</div><div><br></div><p style="margin:0px;font-size:11px;font-family:Menlo">

enum X { a, b, c };</p>
<p style="margin:0px;font-size:11px;font-family:Menlo">int f() {</p>
<p style="margin:0px;font-size:11px;font-family:Menlo">  enum X x = b;</p>
<p style="margin:0px;font-size:11px;font-family:Menlo">  return x;</p>
<div><span style="font-family:Menlo;font-size:11px">}</span></div><div><br></div><div>The warning is technically correct, but it doesn't seem appropriate.  It's not obvious what the right approach is to address this issue.  Do you have any suggestions?</div>
<span class="HOEnZb"><font color="#888888">
<div><br></div><div>-Eli </div></font></span></div><br></div></div>
</blockquote></div><br></div></div>