From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp127.ord1c.emailsrvr.com (smtp127.ord1c.emailsrvr.com [108.166.43.127]) by sourceware.org (Postfix) with ESMTPS id 8EA9E385840A for ; Sun, 24 Jul 2022 04:39:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8EA9E385840A X-Auth-ID: tom@honermann.net Received: by smtp24.relay.ord1c.emailsrvr.com (Authenticated sender: tom-AT-honermann.net) with ESMTPSA id 81BAB6010B; Sun, 24 Jul 2022 00:39:23 -0400 (EDT) From: Tom Honermann 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 Message-Id: <20220724043902.1777378-1-tom@honermann.net> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Classification-ID: 41aea723-eb08-47ec-8fe6-68f417a64c83-1-1 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2022 04:39:26 -0000 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