From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F2BFD3858D1E; Fri, 30 Sep 2022 23:00:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F2BFD3858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664578849; bh=icfvPbpugy7OvmijNXNpjYBwzDxfNQ/DdIJR2g2f4Vw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=UXmmCtmB1bWAuMYAxp1CypxBH3EzmFxTVDmggFJMiPgdplxOn+/+cPbmBwHgKMvvN qf1S4s20vrcosuJ01bnRlt6gxZWR43txE4v5HRVbgUvNjPo62rhj1X/wM0MJRArEDG uYfGY4UTzT4zw/8ZtnoYqkNxNivSzQbFjHtOAhWI= From: "lhyatt at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/91669] #pragma's and _Pragma's work but _Pragma's used in an equivalent macro don't Date: Fri, 30 Sep 2022 23:00:49 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 5.5.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: lhyatt at gcc dot gnu.org X-Bugzilla-Status: NEW 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: cc Message-ID: In-Reply-To: References: 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D91669 Lewis Hyatt changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lhyatt at gcc dot gnu.org --- Comment #4 from Lewis Hyatt --- This is already fixed on the latest GCC 10, 11, and 12 branches and on trunk for GCC 13. There were two separate issues contributing to this problem. The first one = was common to both C and C++, and it was fixed by r10-325 for PR90382. (That PR= was primarily about something else so was not focused on _Pragma locations, but= the fix resolved this PR too.) The second issue made it stay broken longer for C only, not C++. In that se= nse it's partially a dupe of PR97498 and this aspect was fixed by r13-1596. (Is= sue was that in C, input_location used to be always the start of the line.) That fix has been backported to 10, 11, and 12 branches already. The testcase I added in r13-1596 provides partial coverage for this issue as well, but it does not quite cover the issue with adhoc locations addressed = by r10-325. Here is a reduced testcase for this PR: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D #define ENDFUNC \ _Pragma("GCC diagnostic push") \ _Pragma("GCC diagnostic ignored \"-Wreturn-type\"") \ } \ _Pragma("GCC diagnostic pop") int f () { ENDFUNC =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D I will submit a patch to add this testcase and then close this one once tha= t's applied.=