public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tom Honermann <tom@honermann.net>
To: gcc-patches@gcc.gnu.org
Subject: [PATCH 0/1] c++/106423: Fix pragma suppression of -Wc++20-compat diagnostics
Date: Sun, 24 Jul 2022 00:39:01 -0400	[thread overview]
Message-ID: <20220724043902.1777378-1-tom@honermann.net> (raw)

This change addresses the following issue raised on the libc-alpha mailing list:
  https://sourceware.org/pipermail/libc-alpha/2022-July/140825.html
Glibc 2.36 adds a char8_t typedef in C++ modes that do not enable the char8_t
builtin type (C++17 and earlier by default; subject to _GNU_SOURCE and use of
the -f[no-]char8_t option).  When -Wc++20-compat diagnostics are enabled, the
following warning is issued from the glibc uchar.h header.
  warning: identifier ‘char8_t’ is a keyword in C++20 [-Wc++20-compat]
Such diagnostics are not desired from system headers, so glibc would like to
suppress the diagnostic using '#pragma GCC diagnostic ignored "-Wc++20-compat"',
but attempting to do so currently fails.  This patch corrects that.

Tom Honermann (1):
  c++/106423: Fix pragma suppression of -Wc++20-compat diagnostics.

 gcc/c-family/c-opts.cc                 |  7 +++++++
 gcc/c-family/c.opt                     |  2 +-
 gcc/testsuite/g++.dg/cpp0x/keywords2.C | 16 ++++++++++++++++
 gcc/testsuite/g++.dg/cpp2a/keywords2.C | 13 +++++++++++++
 libcpp/include/cpplib.h                |  4 ++++
 libcpp/init.cc                         |  1 +
 6 files changed, 42 insertions(+), 1 deletion(-)
 create mode 100644 gcc/testsuite/g++.dg/cpp0x/keywords2.C
 create mode 100644 gcc/testsuite/g++.dg/cpp2a/keywords2.C

-- 
2.32.0


             reply	other threads:[~2022-07-24  4:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-24  4:39 Tom Honermann [this message]
2022-07-24  4:39 ` [PATCH 1/1] " Tom Honermann
2022-07-27 23:09   ` Joseph Myers
2022-07-30 23:05     ` Tom Honermann
2022-07-31 15:05       ` Lewis Hyatt
2022-07-31 21:41         ` Tom Honermann
2022-08-01 18:49   ` [PATCH 1/1 v2] " Tom Honermann
2022-08-04 16:42     ` Tom Honermann
2022-08-11 22:44       ` Tom Honermann
2022-08-11 23:59         ` Jason Merrill

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=20220724043902.1777378-1-tom@honermann.net \
    --to=tom@honermann.net \
    --cc=gcc-patches@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).