[Bug c/106406] _Static_assert declaration can not be first of for-triplet
chumarshal at foxmail dot com
gcc-bugzilla@gcc.gnu.org
Mon Sep 5 03:28:15 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106406
--- Comment #4 from marshal <chumarshal at foxmail dot com> ---
(In reply to marshal from comment #0)
> int main()
> {
> int i = 4;
> for (_Static_assert (3, "This is a three"); i < 7; i++) {
> i += 2;
> }
> }
>
>
> Gcc can build successfully, but it does not follow C spec:
>
> 6.8.5 Iteration statements
> (Constraints)
> The declaration part of a for statement shall only declare identifiers for
> objects having storage class auto or register.
/*
* (c) Copyright 2016-2021 by Solid Sands B.V.,
* Amsterdam, the Netherlands. All rights reserved.
* Subject to conditions in the RESTRICTIONS file.
*/
More information about the Gcc-bugs
mailing list