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 CE5853858D38 for ; Thu, 23 May 2024 22:41:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CE5853858D38 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 CE5853858D38 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=1716504072; cv=none; b=NGLTjktyK+zDF2QmT7nozY/Rx6FPGVO91kJW1FLTzEFrrIk8tHYOBVwxng9Eb/vielpmTuMNL7TEBG0Hbkyp9XksurHBZ1w9YkyvlfVfu/kinn0FGQR8ZkrwxzkkVh4cQeZh5DYm40EdsNyO6EwLASnSMQRkkik1YgKx9GkxpHg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716504072; c=relaxed/simple; bh=V7pmCYiUXEWjYNcJAjJ239Bq1U2z2doRUnSPZ91l3I8=; h=DKIM-Signature:Message-ID:Date:MIME-Version:From:Subject:To; b=P0LuQpoSgFGiTSyPm1G0Fopcbd/yA+ZKhOUGayn5uZo0Y5kjIUQOkx/oXMePC9yloE5192rUz2VszfAMExXoQowLt3S0Jnau0p5GYM8SdgH7utmYtxaGU1rVqtsHd52VieotWgZTBhx5FnIC58Nh990Dw5RTzI7ILlMS0EgIJi4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716504070; 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=g/2WKzsBIR3tIYmebPxqlQLKmPIFN7HR5hWT+g1829E=; b=QDPut+7SV/tXi+fVlOSy5jNIDnJAMpKYfWMNjVNjVWGpovV314O1y3LtvlZkjViJCH4kpD +PQ80xB+r23u4Zgx3S6yMiLd1w6m43ZnbLtSlADtxiL/4jAYjwg9Iky8o91+1f96y0CHXs 7/lhQweUTNrqSvpVYrW4/1SO5AXaIEE= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-208-SzZocNdOPhqUDfqA-E6OUA-1; Thu, 23 May 2024 18:41:09 -0400 X-MC-Unique: SzZocNdOPhqUDfqA-E6OUA-1 Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-792ca09135dso68119185a.0 for ; Thu, 23 May 2024 15:41:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716504068; x=1717108868; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=g/2WKzsBIR3tIYmebPxqlQLKmPIFN7HR5hWT+g1829E=; b=SSil9rgDhDQLxTYlrJylicYHWRmU1ApHh7WEwQzQY2IGYzmkWggHLBwMuVgNQletaC iol0e+IDrAJ52D+xU/k6l/MbAbu3KhIwvLw8/o+JUfzkF5Gkqjys/uQD5kP8azJ4R0c5 11xgxJQJsJu/zLf0qiBhW2jHgFHB6qHwot/Nxxuh6Vy+UNhQwJLbSpa7NWLsl1GPm3/h g5f6Ht+lwEpE4DodlbqR3DVIakaaWzlEs0lNyZOUbM/WOVp3DyxajO1ZwyXqH44gXZqQ F3ubWTrkx+Wk53YQNdu0tzQ4MxUc6Jtf5NX1RpHDBYmQz5PSrv/Qxfwa0qgUyb4VH+rq GwRw== X-Forwarded-Encrypted: i=1; AJvYcCVBuOyqokW/seXxQzUAqC7VdgCEDydiQsWJlkTXRq5c9/2FsvJDXomANPkZ49yddc8T/Ho0Km2l8vUust2S7hVtxYdPw7eRxw== X-Gm-Message-State: AOJu0Yw+3MhSmvQLgZRKKUjCJECJiKCTsuiOAKiTYZtdznRpr9S/11F6 Tjc6M3c1wVG4mCXb5ji2wbfzs+2/A72jgiZRyDeM3eGOVGq4li30ceaZE0b0aopkWEKeCjj2kx3 bAEmWg64gNtL2waUdkUG8OpWWmtpKM2hsCUt5zeSFqR1EZsnEjzwJLWk= X-Received: by 2002:a05:620a:4115:b0:794:8226:710c with SMTP id af79cd13be357-794ab110933mr72701585a.70.1716504068462; Thu, 23 May 2024 15:41:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFrX4TlXsJV+YEgHq1eRIKsdTeJ9cQzm9UDP/YPkMiNj1Qlj9Kts4dncnrmnBqU2urm6Icfgw== X-Received: by 2002:a05:620a:4115:b0:794:8226:710c with SMTP id af79cd13be357-794ab110933mr72699685a.70.1716504068056; Thu, 23 May 2024 15:41:08 -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 af79cd13be357-794abd3716asm7003385a.125.2024.05.23.15.41.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 23 May 2024 15:41:07 -0700 (PDT) Message-ID: Date: Thu, 23 May 2024 18:41:06 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Jason Merrill Subject: Re: [PATCH][14 backport] c++: Fix instantiation of imported temploid friends [PR114275] To: Nathaniel Shead Cc: Patrick Palka , gcc-patches@gcc.gnu.org, Nathan Sidwell References: <66014130.170a0220.d7c40.0e9b@mx.google.com> <661cb2d3.170a0220.c9922.173d@mx.google.com> <6621d375.170a0220.8591f.8217@mx.google.com> <66229bfe.170a0220.d023c.cb93@mx.google.com> <662f69c6.170a0220.d3cac.81f9@mx.google.com> <66420006.170a0220.4a5f3.40ce@mx.google.com> In-Reply-To: <66420006.170a0220.4a5f3.40ce@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=-6.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,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 List-Id: On 5/13/24 07:56, Nathaniel Shead wrote: >>> @@ -11751,9 +11767,16 @@ tsubst_friend_class (tree friend_tmpl, tree args) >>> if (tmpl != error_mark_node) >>> { >>> /* The new TMPL is not an instantiation of anything, so we >>> - forget its origins. We don't reset CLASSTYPE_TI_TEMPLATE >>> + forget its origins. It is also not a specialization of >>> + anything. We don't reset CLASSTYPE_TI_TEMPLATE >>> for the new type because that is supposed to be the >>> corresponding template decl, i.e., TMPL. */ >>> + spec_entry elt; >>> + elt.tmpl = friend_tmpl; >>> + elt.args = CLASSTYPE_TI_ARGS (TREE_TYPE (tmpl)); >>> + elt.spec = TREE_TYPE (tmpl); >>> + type_specializations->remove_elt (&elt); >> >> For GCC 14.2 let's guard this with if (modules_p ()); for GCC 15 it can be >> unconditional. OK. > > I'm looking to backport this patch to GCC 14 now that it's been on trunk > some time. Here's the patch I'm aiming to add (squashed with the > changes from r15-220-gec2365e07537e8) after cherrypicking the > prerequisite commit r15-58-g2faf040335f9b4; is this OK? > > Or should I keep it as two separate commits to make the cherrypicking > more obvious? Not entirely sure on the etiquette around this. It's OK to squash them, but it's typical to use -x (directly or via git gcc-backport) to mention where a branch change was cherry-picked from, and in this case it would make sense to edit in the second commit so it's clear the backport includes both. OK that way. Jason