From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2054.outbound.protection.outlook.com [40.107.20.54]) by sourceware.org (Postfix) with ESMTPS id 863C53858414 for ; Fri, 16 Jun 2023 14:27:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 863C53858414 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+Y2X3F6GsyaBGqcTusZM6ESMpr+FNJEhA/BziwJ3QZo=; b=f9KJmyx9+xfmtbbNjB0Xa94DlHQQgj9vbl6CMZ1x0eAFEZLkelnzkgC5Y23laIk/hDLn5r0c47KJJOmmw1a3u1479c+hX+K4uC11MngUa9jFeHBV3Ohzq1ZXQbr2sAYpty254uvuhGHiELBG9D+r+9Ekw0LyPQKCrN82HIPqat8= Received: from AS4P192CA0017.EURP192.PROD.OUTLOOK.COM (2603:10a6:20b:5e1::12) by AM7PR08MB5304.eurprd08.prod.outlook.com (2603:10a6:20b:10e::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.29; Fri, 16 Jun 2023 14:27:06 +0000 Received: from AM7EUR03FT015.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:5e1:cafe::18) by AS4P192CA0017.outlook.office365.com (2603:10a6:20b:5e1::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.25 via Frontend Transport; Fri, 16 Jun 2023 14:27:06 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM7EUR03FT015.mail.protection.outlook.com (100.127.140.173) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.26 via Frontend Transport; Fri, 16 Jun 2023 14:27:06 +0000 Received: ("Tessian outbound 945aec65ec65:v136"); Fri, 16 Jun 2023 14:27:05 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 69131b6060cf60c7 X-CR-MTA-TID: 64aa7808 Received: from c382447d5284.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id BDA6A54B-4510-4BA3-A3B1-B67A15854230.1; Fri, 16 Jun 2023 14:26:59 +0000 Received: from EUR02-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id c382447d5284.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 16 Jun 2023 14:26:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QHTSbr2Z1tHp5OVHmTID+FsQgcqkf2xPsSScgU7p+72IB2ylwBq1eQ3VR4SyzLwLjhm1TNFCm1NC8At+Qhbt9fVTi5zT+QMqz1RFCMZWloUAbs4A6AIT+UaT72CVbEidluQuYk+m8EeEG9oRUCWr9ZRybYemdmjwzbzEV9LwftwWVQkBXaFoYB8HSG87ka66Z+u4VvZUXuUd5l7rtbtJj8TVa1bXuGXhzDXW3QlAwKPjZ0d9/ftAY//GxkpG/klFQUs2LDTQDBUGu4hj/a8KD3cAeMR9dv0o1KHfp4IO6S+yDL3OG7UjQ0NOmdjNJ1LaAM09ug8fOxXGQeTRjgR2cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+Y2X3F6GsyaBGqcTusZM6ESMpr+FNJEhA/BziwJ3QZo=; b=Pd7XFLaaCN3ZzxZlsZoHNoJ0LNKwvUTqsf+1zSkl9ROprzD8nntOod0PicGlvT01b6dlfFMoYDR4exv75wjrTForgyDi6bSCncCXmcNQAVlmevvhltqh+DUtNX+EdjLGiZstFuY25QiI5Jv2QvIMzR0DiPtvox/OFBK8+Atyzdc3E+PzcaExBj272OcHyZqNYLjGto95hg8rodCLmr6+SnT3Mw6CBXd6teLw6T+2zhANDDySHBsYJ9Ns5B3u41K28v/Cn1hjBelqFmFv77xjXilaiM+anMAJbIxsBqik8B+kjbUTdwEC4IwFRH4mQ19H+8Gfft7O1OnhRpdySZw7dQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+Y2X3F6GsyaBGqcTusZM6ESMpr+FNJEhA/BziwJ3QZo=; b=f9KJmyx9+xfmtbbNjB0Xa94DlHQQgj9vbl6CMZ1x0eAFEZLkelnzkgC5Y23laIk/hDLn5r0c47KJJOmmw1a3u1479c+hX+K4uC11MngUa9jFeHBV3Ohzq1ZXQbr2sAYpty254uvuhGHiELBG9D+r+9Ekw0LyPQKCrN82HIPqat8= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from PAWPR08MB8958.eurprd08.prod.outlook.com (2603:10a6:102:33e::15) by PAWPR08MB9067.eurprd08.prod.outlook.com (2603:10a6:102:343::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.25; Fri, 16 Jun 2023 14:26:55 +0000 Received: from PAWPR08MB8958.eurprd08.prod.outlook.com ([fe80::202a:45b7:3be8:47d5]) by PAWPR08MB8958.eurprd08.prod.outlook.com ([fe80::202a:45b7:3be8:47d5%6]) with mapi id 15.20.6477.037; Fri, 16 Jun 2023 14:26:54 +0000 Date: Fri, 16 Jun 2023 15:26:52 +0100 From: Alex Coplan To: Jason Merrill Cc: gcc-patches@gcc.gnu.org, Nathan Sidwell , Iain Sandoe Subject: Re: [PATCH v3] c++: Accept elaborated-enum-base with pedwarn Message-ID: References: Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: LO6P265CA0020.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2ff::11) To PAWPR08MB8958.eurprd08.prod.outlook.com (2603:10a6:102:33e::15) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: PAWPR08MB8958:EE_|PAWPR08MB9067:EE_|AM7EUR03FT015:EE_|AM7PR08MB5304:EE_ X-MS-Office365-Filtering-Correlation-Id: 8bb90ae6-e39f-41eb-f74d-08db6e75c2c2 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: ZZ0G1wFVo2I6LTIjRlU6wu2sqkr/8m9XG42GvuCWQv+VvrG7ccTO4eFuUU6UnYb/sqcPndfmxqBxEoxBOgz0xxEoRnaCDof4CUAZUW4q0m12ao/WE8zI5UT6m7qMIIhj+Rsr9SDgYaf4njlH5WkgWiIdK8Vjnn2W2WWImSQC69YM4LbIG2oe7SEIcPHaQ/TT08DuWpetV1q1iKENnAzuZAq0LVh5bumqVuK+G+sWq6y7ZLmZ9HIbyeiAqYVPd3yHLTXrL0yKP0xHl4BPjW9DTS3DsrJI3q+2t564mrn7KdMg7WW/qCF4SR7qEMVwD2wtJ/mWdohNSbRN6UdBN8hSrVNor+E5e0Kq68u5G7nv6l3N66lXLqNqF5PyOPm+LSk5F6fLyQCkOI5jYAMTRK4Awj3ZuJC9Azl+FrIplUBx/NSBZzkYG3i1mUAiekiLYyNaTHisbAb7WO34nrT11PjVBWDEF3tdfG+8hEJ8Ua6bp6rY2JV0oSKJjbtu81OmbX6luAOP4K1ZER9KKhKF2a2nG7pEYlXD7nTCOXHY0f5vOcdSkVlBXAnNNcCLYQTG7X3zWTuWuC/VAxIAYyvUS52E5g== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAWPR08MB8958.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(39860400002)(396003)(346002)(136003)(376002)(451199021)(66946007)(966005)(54906003)(4326008)(86362001)(66476007)(66556008)(6916009)(8936002)(8676002)(6486002)(41300700001)(316002)(36756003)(38100700002)(6506007)(53546011)(5660300002)(478600001)(26005)(6512007)(44832011)(2906002)(186003)(2616005)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB9067 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT015.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 3570a6ad-0bf4-428e-07ff-08db6e75bbe6 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oHsbvWVGa8ndZHoYsyp3SMStWBcgzcVB8RKKQbWzcQVmDZc1FlYQudx/1r8ZiKS9sgb1tUxLGCj4TzOyIZQOX7932H28D01zoRtDjY4UckGXLyxt/6k2/TUIp4mRywTmEVadY5U1U8lBlfUVE7z6awmt7RqF/WwkUmYWcht6znTPw73JQtnJlz3/SyKXuKiA25nbHBOlQfK1DyKlpe2JSoeMGS9wcsLUIFyZGQBeQg1KCBD1BSa6mlmTR7tywxNxFDZ1IKYH/8mrs3hOuXcFvIRudHdCdJ/a63Yi3Uoj80LKEaco0RyhX6zfBMQ0HKVVZa4m/yz05lLfNdtjFei5CsohxUNuAalat15E06cs8bsRBHcq+PRFxGeeAhc1iYninReEYSEiQU2or9S8IJUhzQv9DH9S8SkvdeUNY2X5VUCjM/zbCuQd4rKXTSxSkx7AfNmwUtzWWduWLdvuFnRPLWdYQvFlk1OQQnoxpZ0ld8cLJIVK4PST8/MSZCtNH11CXRMa2YIEjpoFfa/i5rk8Zn803zLSrprHBYZzFJ1b7A+LKRRD+z5y1LzmhcOJLXPtc2m2z5Z0weLYIxpEHiaMFDij0B3bBUfMx2DpxN43Jtbn/g51+wYSVrntojIfMqzgD8FGOKy+06cTCCa6BsMIRj1QGrAEtcespP/X9Fn7RIuHxpjzH1i1/RBhedgwkF1eRx1ZTOaollTHKS32IWigX6/KDG12TzsYLXytr0+RopygtG9fYgGRb8LSP5aH6kKVqDrA92rMY4S/KivbFomwgQ== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(39850400004)(396003)(376002)(346002)(136003)(451199021)(36840700001)(40470700004)(46966006)(2616005)(336012)(82740400003)(40460700003)(83380400001)(356005)(81166007)(2906002)(36756003)(40480700001)(36860700001)(47076005)(8936002)(41300700001)(6486002)(8676002)(6862004)(966005)(316002)(5660300002)(54906003)(4326008)(70206006)(70586007)(478600001)(86362001)(44832011)(82310400005)(53546011)(6506007)(186003)(107886003)(6512007)(26005);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2023 14:27:06.0062 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8bb90ae6-e39f-41eb-f74d-08db6e75c2c2 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM7EUR03FT015.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5304 X-Spam-Status: No, score=-6.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,KAM_DMARC_NONE,KAM_SHORT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY 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: On 16/06/2023 09:07, Jason Merrill wrote: > On 6/16/23 07:58, Alex Coplan wrote: > > Hi, > > > > This is a v3 patch addressing feedback for: > > https://gcc.gnu.org/pipermail/gcc-patches/2023-June/621714.html > > > > The only change since the previous version is that the new option is > > documented in invoke.texi (and the description in c.opt was shortened as > > requested). > > > > ------ > > > > 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=elaborated-enum-base. > > > > This patch adds the -Welaborated-enum-base warning to GCC and adjusts > > the C++ parser to emit this warning instead of rejecting this code > > outright. > > > > The macro expansion in the macOS headers occurs in the case that the > > compiler declares support for enums with underlying type using > > __has_feature, see > > https://gcc.gnu.org/pipermail/gcc-patches/2023-May/618450.html > > > > GCC rejecting this construct outright means that GCC fails to bootstrap > > on Darwin in the case that it (correctly) implements __has_feature and > > declares support for C++ enums with underlying type. > > > > With this patch, GCC can bootstrap on Darwin in combination with the > > (WIP) __has_feature patch posted at: > > https://gcc.gnu.org/pipermail/gcc-patches/2023-May/617878.html > > > > Bootstrapped/regtested on aarch64-linux-gnu and x86_64-apple-darwin. > > OK for trunk? > > OK, thanks. Thanks for the reviews, pushed as g:b106f11dc6adb8df15cc5c268896d314c76ca35f. > > > Thanks, > > Alex > > > > gcc/c-family/ChangeLog: > > > > * c.opt (Welaborated-enum-base): New. > > > > gcc/ChangeLog: > > > > * doc/invoke.texi: Document -Welaborated-enum-base. > > > > gcc/cp/ChangeLog: > > > > * parser.cc (cp_parser_enum_specifier): Don't reject > > elaborated-type-specifier with enum-base, instead emit new > > Welaborated-enum-base warning. > > > > gcc/testsuite/ChangeLog: > > > > * g++.dg/cpp0x/enum40.C: Adjust expected diagnostics. > > * g++.dg/cpp0x/forw_enum6.C: Likewise. > > * g++.dg/cpp0x/elab-enum-base.C: New test. >