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 5C8873858D34 for ; Wed, 1 May 2024 20:52:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5C8873858D34 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 5C8873858D34 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=1714596732; cv=none; b=rohN5vnC+Ksmu/PgDZsfifeUan0ckYakq6qqRbGvDO7SO2zGeBdSeJWLXetsQBBOyxgSEvLVe+BRYqYwld8oCnIbDL6FSeFCp766amEAQcrMbOdGtxbLQBxx25uxO+ndeeP5AMUVaTs7t0cPZMOy6GBxmZh9zzdC0dfmXYNynlY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714596732; c=relaxed/simple; bh=MrGRcE6FcqElG/v5JHZ8MGrHLVUPbyoCizSgksQ1n/o=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=quTiRG0CAsuU0AgFtD4TT5TnbCwrdC2lFcwez91mSz2eUf2Q8eLrbGyNjlzHxT0nZfQ1Bvg8snjwMuD47wLHxwmCdTxdO4+R0S8Ots91cIZxmOQSRWHrWKzCbQuEhSycejql2W4uYxYzMvusQGPvQ59rwWVK19uVKUnmoUSHFJ8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714596731; 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=pLWjDueEHLa2eoB+mAcrN5aWYegT5HvRzUpkuC7RuiM=; b=LsKoexVwYT3mBpZmFV/IvIcEHJuEVqCSkLM83C71e3G8Tk8UGki5zN5XlAlBusiyAiY9wv RP/gXUDmblX6uW12riE3m9s6VSMzVjIAoAx7tvWH4wRDza0vczIthtg1hIdVvw2C1STLwd HxrptM7eHcqrFhpJtumolXqW3res5B4= 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-74-h5LUDO_tPJ2ZmJHw4Bg_2A-1; Wed, 01 May 2024 16:52:09 -0400 X-MC-Unique: h5LUDO_tPJ2ZmJHw4Bg_2A-1 Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-790f573ea3aso463637885a.0 for ; Wed, 01 May 2024 13:52:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714596729; x=1715201529; 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=pLWjDueEHLa2eoB+mAcrN5aWYegT5HvRzUpkuC7RuiM=; b=G9UQ14h5Wy9xrgjP1DcO0CkDY8eeU+vozWGXGomngB0xfhEWth3s2XNdYzSxTjGvDj vD18JOBYTKszT2cCJQztXhKNeyERKlSWoifHA+2rag/y0xgPGOgm0GbLDXgx6EZFqhgc zRnsPWZ+fYbL/rVjQPjl9815VxzLZIEW53lqPT6U1ktHbYRx/7PekmGyeSnIxxmths6x red3siWwmRqoUegHPnBV3paWV1yHzYzY49UXVGdKfrAMmzRau8V83OwAp2Sq4y/H5Rk8 bfCiwJp81xwKYYq4x25/KkcIn7AbogKW+/X9y6e3HpeGn1DMDGo+KUBCTmeCqY/My/7V UF5g== X-Gm-Message-State: AOJu0Yz9+Hm5PV540lbVX7xkOrsz3W/6bJ7SNd5q320U+DNorgAcEw6C pRYs1Ze8EbOcqtYMfcG6n9+rw5nrE2ebzRkD5tR7GuvsDPYw3Bki+rt7zsLPknK2fW8WTUzwfHj 8a2b8CQtYRxzzX/ne18zu7vfs5KnykGhV+QVBeruSAwXLXbAGVz1R+xgpizNyPy8= X-Received: by 2002:a05:620a:5319:b0:78b:e305:8344 with SMTP id oo25-20020a05620a531900b0078be3058344mr4074558qkn.46.1714596728797; Wed, 01 May 2024 13:52:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE97JZW9efS24e4n+dxWehV6aOqxhiMvXtFwzyO6AOXVyg+HKHSjePXK1tYJVnEie4O1vs35g== X-Received: by 2002:a05:620a:5319:b0:78b:e305:8344 with SMTP id oo25-20020a05620a531900b0078be3058344mr4074544qkn.46.1714596728417; Wed, 01 May 2024 13:52: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 c12-20020a05620a134c00b0078f0ee3fcfbsm12469721qkl.46.2024.05.01.13.52.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 01 May 2024 13:52:07 -0700 (PDT) Message-ID: Date: Wed, 1 May 2024 16:52:07 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/2] c++: remove lookup_template_class's entering_scope flag To: Patrick Palka Cc: gcc-patches@gcc.gnu.org References: <20240202194104.317982-1-ppalka@redhat.com> <20240202194104.317982-2-ppalka@redhat.com> <1053294c-b63c-b40b-0ba2-069e2bd615c3@idea> <0182a4aa-cb43-42ec-b8fd-c9a23424d889@redhat.com> <823f5898-02d1-e6a3-8e18-aa3695193a0f@idea> From: Jason Merrill In-Reply-To: <823f5898-02d1-e6a3-8e18-aa3695193a0f@idea> 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.7 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/1/24 13:40, Patrick Palka wrote: > On Wed, 1 May 2024, Jason Merrill wrote: > >> On 5/1/24 12:41, Patrick Palka wrote: >>> On Fri, 2 Feb 2024, Patrick Palka wrote: >>> >>>> Bootstrapped and regtested on x86_64-pc-linux, does this look like >>>> an improvement? This is not a bugfix and barely related to the previous >>>> patch, but the previous patch's new use of entering_scope=true motivated >>>> me to submit this patch since it seems like a nice simplification. >>> >>> Ping, now that stage 1 is open. >> >> Thanks for the ping. The earlier message isn't showing up in Thunderbird for >> some reason, though I see it in the gmail web interface... > > Ah, weird. No worries, this patch was very much stage 1 material anyway. > >> >>>> @@ -16771,9 +16722,10 @@ tsubst (tree t, tree args, tsubst_flags_t >>>> complain, tree in_decl) >>>> ctx = TREE_VEC_ELT (ctx, 0); >>>> } >>>> else >>>> - ctx = tsubst_aggr_type (ctx, args, >>>> - complain | tf_qualifying_scope, >>>> - in_decl, /*entering_scope=*/1); >>>> + { >>>> + ctx = tsubst_scope (ctx, args, complain, in_decl); >> >> Why is this one tsubst_scope while the others are all plain tsubst? > > Ah, just because the call to tsubst_aggr_type being replace passes > tf_qualifying_scope already, so we might as well use tsubst_scope > as shorthand. > >> Do we want a tsubst_entering_scope function? > > Which is just shorthand for tsubst + adjust_type_for_entering_scope? That's what I was thinking. > Sure, though I was wondering if we eventually might want to get rid of > the distinction between the primary template type A and the generic > instantiation A, and we could treat this as an incremental step > towards that (then we'd just eventually remove the > adjust_type_for_entering_scope calls and keep the tsubst calls). I don't think we want that; having the distinction helps to avoid wrongly looking up members of the primary template in contexts that shouldn't be able to. Jason