From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0DF633858406; Tue, 7 Dec 2021 08:16:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0DF633858406 From: "sbergman at redhat dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/103597] New: False -Wimplicit-fallthrough= involving macro Date: Tue, 07 Dec 2021 08:16:00 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: sbergman at redhat dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2021 08:16:01 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103597 Bug ID: 103597 Summary: False -Wimplicit-fallthrough=3D 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 =E2=80=98int f(int)=E2=80=99: > test.cc:1:17: warning: this statement may fall through [-Wimplicit-fallth= rough=3D] > 1 | #define E(c, e) if (c) e > | ^~ > test.cc:5:9: note: in expansion of macro =E2=80=98E=E2=80=99 > 5 | E(true, return 0); > | ^ > test.cc:6:5: note: here > 6 | case 1: > | ^~~~=