From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 4177A3858C20 for ; Thu, 8 Jun 2023 18:06:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4177A3858C20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686247606; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=H1dauMkeGe2QXxCavieBAuWkqITC5cO9sB9/VYKDZlQ=; b=h+yBCWIgZctdlVy0f0CzDov9bhcCXtYkGvtohRrc1v/qLDF2lcEncwZNC9S6Vcje/7onhE 5Rew++crqP1h0KRd0uGCKE/oZD/UQv1st3SV3jGPCyjX+ZpfAF9G4eXAp7IWZ+dRr/T2GT ccXFjwvlWr32uzri3qg4MlxJh2XIdGE= Received: from mail-oi1-f200.google.com (mail-oi1-f200.google.com [209.85.167.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-441-JV1GnsobOg2TNK4vXq4i8g-1; Thu, 08 Jun 2023 14:06:40 -0400 X-MC-Unique: JV1GnsobOg2TNK4vXq4i8g-1 Received: by mail-oi1-f200.google.com with SMTP id 5614622812f47-39a5ff5b71cso825300b6e.1 for ; Thu, 08 Jun 2023 11:06:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686247598; x=1688839598; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=H1dauMkeGe2QXxCavieBAuWkqITC5cO9sB9/VYKDZlQ=; b=gWR4WWjPSunwuj0mKEwGW8+rhUu3b5YquCriBy7RCixtXYXRtyEhW1/nyb1Kf7FLKg zJFpv0zX2iMnHW4lhui6vw1320SbF+DfEeDzQYmwd/CsVeKH1Rug4+moZmHf44X1wjI+ dcGz01v0lBHg2TBgyVrxJug+luckYaQBelFbR4GJL8eAJ34q71ERxJEhKNaFonUiHcZs ngosDKFv5UbwQf9T1H1JpMMVoJJx07QcwQ9cwZhrpWgTYpGeMiWkUMNBfIPiHN35D8+0 IA20Ctn6+DHPaKaWE4MT2Imio7mn7bvG4HgDlb103VqHLHqISwMVozOT9FnxvN1Gd/ZQ lviQ== X-Gm-Message-State: AC+VfDwPjjKBdGa61BxqnIcKadRk7l5QLWt12dv1q3+zGDOYMry7bOfJ tDOTQf39GwpjNXT4wITZEAYR9sXIfZmsbF8YBxAPEhap+RntVsG46a7bSU4T4eKbBIMrUHM4Z4N 5jPFJX29K/RFVXRazsw== X-Received: by 2002:aca:670a:0:b0:39a:babe:a0c with SMTP id z10-20020aca670a000000b0039ababe0a0cmr8648754oix.7.1686247598130; Thu, 08 Jun 2023 11:06:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7yc5+mL5omcbYq+al7aeXijeRuS2rJoCHpvFeojvuuSbcge8mvucoFz52UoZCr1B4i4EFNBA== X-Received: by 2002:aca:670a:0:b0:39a:babe:a0c with SMTP id z10-20020aca670a000000b0039ababe0a0cmr8648742oix.7.1686247597939; Thu, 08 Jun 2023 11:06:37 -0700 (PDT) Received: from [192.168.1.108] (130-44-146-16.s12558.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [130.44.146.16]) by smtp.gmail.com with ESMTPSA id z2-20020a0cf242000000b006274936a146sm556495qvl.130.2023.06.08.11.06.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Jun 2023 11:06:37 -0700 (PDT) Message-ID: <48d02699-428f-1fa5-4478-862199e78dd6@redhat.com> Date: Thu, 8 Jun 2023 14:06:36 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.2 Subject: Re: [PATCH][RFC] c++: Accept elaborated-enum-base in system headers To: Alex Coplan , gcc-patches@gcc.gnu.org Cc: Nathan Sidwell , Iain Sandoe References: From: Jason Merrill In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham 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 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=elaborated-enum-base. I guess we might as well follow that example, and so instead of this check: > + || (underlying_type && !in_system_header_at (colon_loc))) Make the below an on-by-default pedwarn using OPT_Welaborated_enum_base, and don't return error_mark_node. > + 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");