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.133.124]) by sourceware.org (Postfix) with ESMTPS id 8A8593858D20 for ; Tue, 30 Apr 2024 18:16:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8A8593858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8A8593858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714501002; cv=none; b=rM18JM6lBxKLwO4HtdobAnVuU54csmvC1FYXWn0VWkhJ95XUA/7f4BjlwwyRq7VOOp+yW21l6IWE3Nyocs9VPCKvGOZs40PRx0Wz5uR0b79r9DFNzgO1kWeNGgPp2/7g+NMO2uJr6xXfec6TVHqB82NIZ/0M3hOZyujOxKE8BFU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714501002; c=relaxed/simple; bh=uT3rebpSBSvnSIKNy3g5BSPK3e6SiSSw0R5uirYtK6o=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=vqfmOKN5tOLAcfauYBavaO+TKX5IcJ9Fm/ihJvavsAQ1vpX70fqBeieuWv0PUdKpQzdaC6wJPEUquYFhiISM3BKZJLiRpTBmBP/6X89OCeWS1Cx0QNNrE/FmhLiAe563J8i45Xj4PcaaX/fC/grDR+loD5HDGuCUBToIIZOBIdw= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714500999; 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=41PFLmfTwnJ+dyXGVShw2dKESwK8EpHexBOzTGqUcIg=; b=intzdV0tVh7piB1P1kErQ0O4cHQDYVOUQfsZ7lGwfeDz0OCJBjmD84ba41gvEWiV3CVBdq FtRATcZn4lDJpH8wClmyszlRMiWJdi6Yg4upejmwMb2uxG4JN6qHhsJwAxJ3ldJKbJ2/+i 3TJkb4G66+sztrgl8eJOPfstjbjUGrk= 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-38-YuHNw5AdOGWZFlaafpn5GQ-1; Tue, 30 Apr 2024 14:16:36 -0400 X-MC-Unique: YuHNw5AdOGWZFlaafpn5GQ-1 Received: by mail-oi1-f200.google.com with SMTP id 5614622812f47-3c74d1dc6b6so9526046b6e.0 for ; Tue, 30 Apr 2024 11:16:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714500996; x=1715105796; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=41PFLmfTwnJ+dyXGVShw2dKESwK8EpHexBOzTGqUcIg=; b=XRLDZnutJbC7Mw5pmvEH9npHirBv6RBRsOgNOO7xQRhTa0tQ2Sx1KAObfCcfTH6zlD RyM1HqJIMTZaNGtYb1eLz6w+gpR3sfiAK4tBPOJGyB8KKY3/hsou8LRhyXm3iduahHkO fwlZcQBWk2HYlr7qBVtSPVESU5XXdrv3JqTjz3QkEcrJKFaZC2vFCP2o8Z2ifNXB9WYt BRu0/ffL+UQdlr5I7DrQUCJscLh2QntHgbksMGY4uruVb0JFjoIY9HpqJ8S/qnqI+Rls LlxEOpWeAQ7XgX3M7QHKTFR6v3WsTllfOFaNq/V3Xs3sC7liat+k38qBRI/PcBLOEzNb 29xg== X-Gm-Message-State: AOJu0YzCIFjlEVttKypmlz4qez0pze0iItAZ7ITQuWCrQpZZjaLHOWcP iTxsBqhUjj0OkgCE6RcSaQXJqRw54sYuOnQ6c2DUoB+uqujAWWjQ93OZCdxqH2rwn0ZCSa5tzYH nkcCAQP4LhofdO3H/lfSmQ6CHWe28y30pOhQsWT73MoMBYdmGbC3fOtg= X-Received: by 2002:a54:4402:0:b0:3c7:5091:54e5 with SMTP id k2-20020a544402000000b003c7509154e5mr442102oiw.21.1714500995816; Tue, 30 Apr 2024 11:16:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IECIhkODNUY/o8z+eDzLnhjMYCSYh2LSX+bvWGHimTe1nKTAoIv+s6mUSU8cNs0/F43M24mmQ== X-Received: by 2002:a54:4402:0:b0:3c7:5091:54e5 with SMTP id k2-20020a544402000000b003c7509154e5mr442085oiw.21.1714500995491; Tue, 30 Apr 2024 11:16:35 -0700 (PDT) Received: from [192.168.1.130] (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 h5-20020ac85485000000b00439cccb91b2sm7736109qtq.73.2024.04.30.11.16.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 30 Apr 2024 11:16:34 -0700 (PDT) Message-ID: Date: Tue, 30 Apr 2024 14:16:34 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/3] c++/modules: Propagate using decls from partitions To: Nathaniel Shead Cc: gcc-patches@gcc.gnu.org, Nathan Sidwell , Patrick Palka References: <66188279.170a0220.e9635.a08c@mx.google.com> <66188303.170a0220.8de00.5a7c@mx.google.com> <6b74f1ea-e301-4f1c-9f21-4dc2ab78d924@redhat.com> <661aa767.170a0220.a291e.1721@mx.google.com> <6630a4e9.170a0220.590a6.cb55@mx.google.com> From: Jason Merrill In-Reply-To: <6630a4e9.170a0220.590a6.cb55@mx.google.com> 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=-12.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,URIBL_BLACK 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 4/30/24 00:59, Nathaniel Shead wrote: > On Sun, Apr 14, 2024 at 01:40:18AM +1000, Nathaniel Shead wrote: >> On Fri, Apr 12, 2024 at 01:50:47PM -0400, Jason Merrill wrote: >>> On 4/11/24 20:40, Nathaniel Shead wrote: >>>> Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? >>>> >>>> -- >8 -- >>>> >>>> The modules code currently neglects to set OVL_USING_P on the dependency >>>> created for a using-decl, which causes it not to remember that the >>>> OVL_EXPORT_P flag had been set on it when emitted from the primary >>>> interface unit. This patch ensures that it occurs. >>>> >>>> gcc/cp/ChangeLog: >>>> >>>> * module.cc (depset::hash::add_binding_entity): Propagate >>>> OVL_USING_P for using-declarations. >>>> >>>> gcc/testsuite/ChangeLog: >>>> >>>> * g++.dg/modules/using-15_a.C: New test. >>>> * g++.dg/modules/using-15_b.C: New test. >>>> * g++.dg/modules/using-15_c.C: New test. >>>> >>>> Signed-off-by: Nathaniel Shead >>>> --- >>>> gcc/cp/module.cc | 4 ++++ >>>> gcc/testsuite/g++.dg/modules/using-15_a.C | 13 +++++++++++++ >>>> gcc/testsuite/g++.dg/modules/using-15_b.C | 5 +++++ >>>> gcc/testsuite/g++.dg/modules/using-15_c.C | 7 +++++++ >>>> 4 files changed, 29 insertions(+) >>>> create mode 100644 gcc/testsuite/g++.dg/modules/using-15_a.C >>>> create mode 100644 gcc/testsuite/g++.dg/modules/using-15_b.C >>>> create mode 100644 gcc/testsuite/g++.dg/modules/using-15_c.C >>>> >>>> diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc >>>> index 9d054c4c792..527c9046c67 100644 >>>> --- a/gcc/cp/module.cc >>>> +++ b/gcc/cp/module.cc >>>> @@ -12915,10 +12915,12 @@ depset::hash::add_binding_entity (tree decl, WMB_Flags flags, void *data_) >>>> /* Ignore NTTP objects. */ >>>> return false; >>>> + bool unscoped_enum_const_p = false; >>>> if (!(flags & WMB_Using) && CP_DECL_CONTEXT (decl) != data->ns) >>>> { >>>> /* A using that lost its wrapper or an unscoped enum >>>> constant. */ >>>> + unscoped_enum_const_p = (TREE_CODE (decl) == CONST_DECL); >>> >>> How does this interact with C++20 using enum? >> >> Looks like it ignores those (so they still suffer from this error). But >> in general we don't handle usings of non-functions correctly anyway yet >> (for the reasons I described in the cover letter); I just added this for >> now to prevent regressing some test-cases caused by importing enum >> consts wrapped in an OVERLOAD. >> >> Otherwise happy to defer this patch until GCC 15 when I can look at >> exploring what needs to be done to handle non-function using-decls >> correctly, but I'll need to work out a new testcase for the followup >> patch in this series (or just defer that one too, I suppose). > > Ping. Or should I just scrap this patch for now, find a new testcase > for the followup patch, and submit it again once we have a general > solution for using-decls of non-functions? Please add a FIXME about using enum here and a using enum testcase to the appropriate PR; OK for trunk and 14.2 with that change. Jason