File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments