public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "lhyatt at gcc dot gnu.org" <gcc-bugzilla@gcc.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	[thread overview]
Message-ID: <bug-91669-4-4saLXb1e4j@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-91669-4@http.gcc.gnu.org/bugzilla/>

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

Lewis Hyatt <lhyatt at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lhyatt at gcc dot gnu.org

--- Comment #4 from Lewis Hyatt <lhyatt at gcc dot gnu.org> ---
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 sense
it's partially a dupe of PR97498 and this aspect was fixed by r13-1596. (Issue
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:

=======================
#define ENDFUNC \
    _Pragma("GCC diagnostic push") \
    _Pragma("GCC diagnostic ignored \"-Wreturn-type\"") \
     } \
     _Pragma("GCC diagnostic pop")

int f () {
ENDFUNC
=======================

I will submit a patch to add this testcase and then close this one once that's
applied.

  parent reply	other threads:[~2022-09-30 23:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-91669-4@http.gcc.gnu.org/bugzilla/>
2021-10-29 16:25 ` burnus at gcc dot gnu.org
2021-10-29 17:40 ` burnus at gcc dot gnu.org
2022-09-30 23:00 ` lhyatt at gcc dot gnu.org [this message]
2022-10-04  1:29 ` cvs-commit at gcc dot gnu.org
2022-10-04  1:34 ` lhyatt at gcc dot gnu.org
2022-10-19 20:29 ` lhyatt at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-91669-4-4saLXb1e4j@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).