Hi Chandler,<br><br><div class="gmail_quote">On Fri, May 25, 2012 at 11:15 PM, Chandler Carruth <span dir="ltr"><<a href="mailto:chandlerc@google.com" target="_blank">chandlerc@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="gmail_quote"><div><div class="h5">On Fri, May 25, 2012 at 11:15 AM, Alexander Kornienko <span dir="ltr"><<a href="mailto:alexfh@google.com" target="_blank">alexfh@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Hi cfe-commits,<div><br></div><div>This patch handles a specific (but surprisingly common) case when a fall-through occurs to a switch label immediately followed by a <font face="courier new, monospace">break;</font>. In this case it doesn't make sense to suggest a fall-through annotation, almost certainly inserting <font face="courier new, monospace">break;</font> is a good fix-it.</div>


<div>Example:</div><div><br></div><div><font face="courier new, monospace">switch (x) {</font></div><div><font face="courier new, monospace">  case 111:</font></div><div><font face="courier new, monospace">    f();</font></div>


<div><font face="courier new, monospace">  case 222: // don't offer "[[clang::fallthrough]];", just "break;"</font></div><div><font face="courier new, monospace">    break;</font></div><div><font face="courier new, monospace">}</font></div>


<div><div><br></div><div>Please, review this patch.</div></div></blockquote><div><br></div></div></div><div>Seems generally good. I think we have 'isa_or_null' which would simplify the code implementing it a bit i think? Maybe I've mis-remembered.</div>
</div></blockquote><div>Nope:</div><div><pre id="c8" class="stx-plain" style="margin-top:0px;margin-bottom:0px;padding-top:0.5em;line-height:16px;background-color:rgb(255,255,255);font-size:medium"><span id="c8_10" class="stx-line" style="display:block"><span class="stx-comment" style="color:rgb(136,0,0)">// This file defines the isa<X>(), cast<X>(), dyn_cast<X>(), cast_or_null<X>(),
</span></span><span id="c8_11" class="stx-line" style="display:block"><span class="stx-comment" style="color:rgb(136,0,0)">// and dyn_cast_or_null<X>() templates.</span></span></pre></div></div><div><br></div>I could use dyn_cast_or_null, but it will not make code clearer.<br clear="all">
<div><br></div><div>If it looks good, could you commit it? I don't have commit access yet.</div><div><br></div>-- <br>
<div>Regards,</div><div>Alex</div>