Skip to content

Commit

Permalink
Add additional test coverage for C2x N2508
Browse files Browse the repository at this point in the history
This spotted a mistake with the original patch, so it puts the status
back to "partial" in the C status tracking page.

This amends 5103836.
  • Loading branch information
AaronBallman committed Sep 19, 2022
1 parent 8206044 commit a244194
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
22 changes: 22 additions & 0 deletions clang/test/C/C2x/n2508.c
@@ -0,0 +1,22 @@
// RUN: %clang_cc1 -verify -std=c2x %s

/* WG14 N2508: partial
* Free positioning of labels inside compound statements
*/
void test() {
{
inner:
}

switch (1) {
// FIXME: this should be accepted per C2x 6.8.2p2.
case 1: // expected-error {{label at end of switch compound statement: expected statement}}
}

{
multiple: labels: on: a: line:
}

final:
}

8 changes: 7 additions & 1 deletion clang/www/c_status.html
Expand Up @@ -763,7 +763,13 @@ <h2 id="c2x">C2x implementation status</h2>
<tr>
<td>Free positioning of labels inside compound statements</td>
<td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2508.pdf">N2508</a></td>
<td class="unreleased" align="center">Clang 16</td>
<td class="partial" align="center">
<details><summary>Partial</summary>
Clang supports labels at the end of compound statements but does
not yet support <code>case</code> or <code>default</code> labels at
the end of a switch statement's compound block.
</details>
</td>
</tr>
<tr>
<td>Clarification request for C17 example of undefined behavior</td>
Expand Down

0 comments on commit a244194

Please sign in to comment.