From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp001-out.apm-internet.net (smtp001-out.apm-internet.net [85.119.248.222]) by sourceware.org (Postfix) with ESMTPS id B83F13858C20 for ; Thu, 8 Jun 2023 18:47:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B83F13858C20 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=sandoe.co.uk Authentication-Results: sourceware.org; spf=none smtp.mailfrom=sandoe.co.uk Received: (qmail 8378 invoked from network); 8 Jun 2023 18:47:19 -0000 X-APM-Out-ID: 16862500390837 X-APM-Authkey: 257869/1(257869/1) 4 Received: from unknown (HELO smtpclient.apple) (81.138.1.83) by smtp001.apm-internet.net with SMTP; 8 Jun 2023 18:47:19 -0000 From: Iain Sandoe Content-Type: multipart/alternative; boundary="Apple-Mail=_EF3AF4F0-1847-43CD-92BC-7469B0C7EFE7" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.3\)) Subject: Fwd: [PATCH][RFC] c++: Accept elaborated-enum-base in system headers Date: Thu, 8 Jun 2023 19:47:19 +0100 References: <48d02699-428f-1fa5-4478-862199e78dd6@redhat.com> Cc: Alex Coplan , Nathan Sidwell , GCC Patches To: Jason Merrill Message-Id: <431E4F83-136F-47AA-8D94-E1E517C67644@sandoe.co.uk> X-Mailer: Apple Mail (2.3696.120.41.1.3) X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00,HTML_MESSAGE,KAM_COUK,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --Apple-Mail=_EF3AF4F0-1847-43CD-92BC-7469B0C7EFE7 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > Begin forwarded message: >=20 > From: Jason Merrill > Subject: Re: [PATCH][RFC] c++: Accept elaborated-enum-base in system head= ers > Date: 8 June 2023 at 19:06:36 BST > To: Alex Coplan , gcc-patches@gcc.gnu.org > Cc: Nathan Sidwell , Iain Sandoe >=20 > On 6/8/23 07:06, Alex Coplan wrote: >> Hi, >> macOS SDK headers using the CF_ENUM macro can expand to invalid C++ code >> of the form: >> typedef enum T : BaseType T; >> i.e. an elaborated-type-specifier with an additional enum-base. >> Upstream LLVM can be made to accept the above construct with >> -Wno-error=3Delaborated-enum-base. >=20 > I guess we might as well follow that example, and so instead of this chec= k: >=20 >> + || (underlying_type && !in_system_header_at (colon_loc))) >=20 > Make the below an on-by-default pedwarn using OPT_Welaborated_enum_base, = and don't return error_mark_node. I was also wondering about (for this and other reasons) a -fclang-compat to= put some of these things behind (since std=3Dclang++NN is not really going= to work to describe other non-standard extensions etc. since most are not = synchronised to std revisions.) Iain >=20 >> + cp_parser_commit_to_tentative_parse (parser); >> + error_at (colon_loc, >> + "declaration of enumeration with " >> + "fixed underlying type and no enumerator list is " >> + "only permitted as a standalone declaration"); >=20 >=20 --Apple-Mail=_EF3AF4F0-1847-43CD-92BC-7469B0C7EFE7--