From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C3CC43857815; Thu, 7 Jul 2022 14:05:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C3CC43857815 From: "lhyatt at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug preprocessor/69543] [10/11/12/13 Regression] _Pragma does not apply within macro Date: Thu, 07 Jul 2022 14:05:30 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: preprocessor X-Bugzilla-Version: 6.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: lhyatt at gcc dot gnu.org X-Bugzilla-Status: WAITING X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: dmalcolm at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.4 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: see_also 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 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: Thu, 07 Jul 2022 14:05:30 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D69543 Lewis Hyatt changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://gcc.gnu.org/bugzill | |a/show_bug.cgi?id=3D97498 CC| |lhyatt at gcc dot gnu.org --- Comment #20 from Lewis Hyatt --- See PR97498 which is closely related to this. It seems that the use of input_location while handling diagnostic pragmas is problematic in other ca= ses besides the one discussed here (i.e. also when processing a diagnostic pop.) Here is a test case from that PR, which breaks because of the input_location workaround discussed here though: =3D=3D=3D=3D=3D=3D static void f() {} _Pragma("GCC diagnostic error \"-Wunused-function\"") =3D=3D=3D=3D=3D=3D The above errors for C but not C++, because in C, input_location points to = the start of the line and so it takes effect too early.=