Skip to content

Commit a4f3c53

Browse files
committed
Fix one more test
1 parent 1806f61 commit a4f3c53

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

clang/test/C/C11/n1330.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,12 @@ void test(void) {
4343
_Static_assert(1, "this works");
4444
_Static_assert(0, "this fails"); // expected-error {{static assertion failed: this fails}}
4545

46-
// The use of a _Static_assert in a for loop declaration is prohibited per
47-
// 6.8.5p3 requiring the declaration to only declare identifiers for objects
46+
// While the use of a _Static_assert in a for loop declaration is prohibited per
47+
// 6.8.5p3 (requiring the declaration to only declare identifiers for objects
4848
// having auto or register storage class; a static assertion does not declare
49-
// an identifier nor an object.
50-
// FIXME: this diagnostic is pretty terrible.
49+
// an identifier nor an object), we permit it as an extension.
5150
int i = 0;
52-
for (_Static_assert(1, "this should not compile"); i < 10; ++i) // expected-error {{expected identifier or '('}} \
53-
expected-error {{expected ';' in 'for' statement specifier}}
51+
for (_Static_assert(1, "this should compile"); i < 10; ++i)
5452
;
5553

5654
// Ensure that only an integer constant expression can be used as the

0 commit comments

Comments
 (0)