public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/106406] New: _Static_assert declaration can not be first of for-triplet
@ 2022-07-22  9:51 chumarshal at foxmail dot com
  2022-07-22 11:55 ` [Bug c/106406] " rguenth at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: chumarshal at foxmail dot com @ 2022-07-22  9:51 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106406

            Bug ID: 106406
           Summary: _Static_assert declaration can not be first of
                    for-triplet
           Product: gcc
           Version: rust/master
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: chumarshal at foxmail dot com
  Target Milestone: ---

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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-09-05  3:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-22  9:51 [Bug c/106406] New: _Static_assert declaration can not be first of for-triplet chumarshal at foxmail dot com
2022-07-22 11:55 ` [Bug c/106406] " rguenth at gcc dot gnu.org
2022-07-25 19:27 ` pinskia at gcc dot gnu.org
2022-07-25 19:37 ` pinskia at gcc dot gnu.org
2022-09-05  3:28 ` chumarshal at foxmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).