public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/103597] New: False -Wimplicit-fallthrough= involving macro
@ 2021-12-07  8:16 sbergman at redhat dot com
  2021-12-07  8:29 ` [Bug c++/103597] [12 Regression] False -Wimplicit-fallthrough= involving macro since r12-5638-ga3e75c1491cd2d50 marxin at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: sbergman at redhat dot com @ 2021-12-07  8:16 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 103597
           Summary: False -Wimplicit-fallthrough= involving macro
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sbergman at redhat dot com
  Target Milestone: ---

I think this is a recent regression on GCC 12 trunk (I'm at
basepoints/gcc-12-5818-g30a08286e67; it doesn't happen with e.g.
gcc-c++-11.2.1-1.fc35.x86_64):

> $ cat test.cc
> #define E(c, e) if (c) e
> int f(int n) {
>     switch (n) {
>     case 0:
>         E(true, return 0);
>     case 1:
>         return 1;
>     }
>     return 2;
> }

> $ g++ -c -Wimplicit-fallthrough test.cc
> test.cc: In function ‘int f(int)’:
> test.cc:1:17: warning: this statement may fall through [-Wimplicit-fallthrough=]
>     1 | #define E(c, e) if (c) e
>       |                 ^~
> test.cc:5:9: note: in expansion of macro ‘E’
>     5 |         E(true, return 0);
>       |         ^
> test.cc:6:5: note: here
>     6 |     case 1:
>       |     ^~~~

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

end of thread, other threads:[~2022-03-29 18:12 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-07  8:16 [Bug c++/103597] New: False -Wimplicit-fallthrough= involving macro sbergman at redhat dot com
2021-12-07  8:29 ` [Bug c++/103597] [12 Regression] False -Wimplicit-fallthrough= involving macro since r12-5638-ga3e75c1491cd2d50 marxin at gcc dot gnu.org
2021-12-07 11:24 ` jakub at gcc dot gnu.org
2021-12-07 11:33 ` pinskia at gcc dot gnu.org
2021-12-07 12:09 ` jakub at gcc dot gnu.org
2021-12-07 18:53 ` jakub at gcc dot gnu.org
2021-12-07 19:07 ` mpolacek at gcc dot gnu.org
2022-03-28 16:05 ` [Bug debug/103597] " jason at gcc dot gnu.org
2022-03-29  0:09 ` [Bug middle-end/103597] " mpolacek at gcc dot gnu.org
2022-03-29 18:11 ` cvs-commit at gcc dot gnu.org
2022-03-29 18:12 ` mpolacek at gcc dot gnu.org

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).