Add additional test coverage for C2x N2508

This spotted a mistake with the original patch, so it puts the status
back to "partial" in the C status tracking page.

This amends 510383626f.
This commit is contained in:
Aaron Ballman 2022-09-19 07:50:53 -04:00
parent 8206044183
commit a244194f73
2 changed files with 29 additions and 1 deletions

22
clang/test/C/C2x/n2508.c Normal file
View File

@ -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:
}

View File

@ -763,7 +763,13 @@ conformance.</p>
<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>