<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:rnk@google.com" title="Reid Kleckner <rnk@google.com>"> <span class="fn">Reid Kleckner</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED WORKSFORME - variable reassignment in switch not detected ?"
   href="http://llvm.org/bugs/show_bug.cgi?id=20950">bug 20950</a>
        <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>NEW
           </td>
           <td>RESOLVED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">CC</td>
           <td>
                
           </td>
           <td>rnk@google.com
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>WORKSFORME
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED WORKSFORME - variable reassignment in switch not detected ?"
   href="http://llvm.org/bugs/show_bug.cgi?id=20950#c2">Comment # 2</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED WORKSFORME - variable reassignment in switch not detected ?"
   href="http://llvm.org/bugs/show_bug.cgi?id=20950">bug 20950</a>
              from <span class="vcard"><a class="email" href="mailto:rnk@google.com" title="Reid Kleckner <rnk@google.com>"> <span class="fn">Reid Kleckner</span></a>
</span></b>
        <pre>We have a related warning under -Wimplicit-fallthrough, but it isn't on by
default due to false positives on existing code bases.


$ clang++ t.cpp -c -Wimplicit-fallthrough
t.cpp:8:5: warning: unannotated fall-through between switch labels
[-Wimplicit-fallthrough]
    case 2: m = 3;
    ^
t.cpp:8:5: note: insert '[[clang::fallthrough]];' to silence this warning
    case 2: m = 3;
    ^
    [[clang::fallthrough]];
t.cpp:8:5: note: insert 'break;' to avoid fall-through
    case 2: m = 3;
    ^
    break;
t.cpp:9:5: warning: unannotated fall-through between switch labels
[-Wimplicit-fallthrough]
    case 3: m = 4;
    ^
t.cpp:9:5: note: insert '[[clang::fallthrough]];' to silence this warning
    case 3: m = 4;
    ^
    [[clang::fallthrough]];
t.cpp:9:5: note: insert 'break;' to avoid fall-through
    case 3: m = 4;
    ^
    break;
t.cpp:10:5: warning: unannotated fall-through between switch labels
[-Wimplicit-fallthrough]
    case 4: m = 5;
    ^
t.cpp:10:5: note: insert '[[clang::fallthrough]];' to silence this warning
    case 4: m = 5;
    ^
    [[clang::fallthrough]];
t.cpp:10:5: note: insert 'break;' to avoid fall-through
    case 4: m = 5;
    ^
    break;
3 warnings generated.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>