<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Poor diagnostic for missing semicolon before case label"
   href="https://bugs.llvm.org/show_bug.cgi?id=52328">52328</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Poor diagnostic for missing semicolon before case label
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Frontend
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>hans@chromium.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>$ cat /tmp/a.c
void f(int x) {
         switch (x) {
         case 0: return  // <-- Missing semicolon.
         case 1: return;
         }
}

$ clang -c /tmp/a.c
/tmp/a.c:4:10: error: expected expression
         case 1: return;
         ^
1 error generated.



When the return statement has an expression, we get it right:

$ cat /tmp/b.c
int f(int x) {
         switch (x) {
         case 0: return 1  // <-- Missing semicolon.
         case 1: return 2;
         }
}

$ clang -c /tmp/b.c
/tmp/b.c:3:26: error: expected ';' after return statement
         case 0: return 1  // <-- Missing semicolon.
                         ^
                         ;
1 error 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>