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 9895A3858407 for ; Tue, 9 Jan 2024 19:27:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9895A3858407 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 9895A3858407 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=1704828464; cv=none; b=r9RRJMWjAe8MyD7rQit6fpCBPkRNDTK5ciS5W6oPsPAZWnflMXEf+LkgKQFuce3RBZcoDmnj9A2xTuP6N0KhnRIuooldPe0aCDudA4YpExJeUaAvi9YvpJ8SqGcBjBaX+7hkzBSf252uTTUKu6UcFN6lUfP/chq+fvxghooUbAQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704828464; c=relaxed/simple; bh=ZhIL28SgcsGysAG+HaL3zqjnYhZyhvWsssL0PansaCY=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=rq3CpzHTb8kh5+xAby7HGFd8mPi3XIshZlezL1rwlbFG6t/ZFPyNeQ+LP9aOaYWfg4EKnsKLyNY/1OicHgas/eBjkKuO8Ui01plqcWy/t97dXLtjoGd13/M8JUyXBYVvNk/udO4LcAuUvKRUzcCFZh/AZkTgBuy/uV4haaBhaPQ= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704828461; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TNjq13Z9JNVgf+0yltHPemy7XL2lLAG7Gst1lpZmvCA=; b=D+f8c0Bmsx1sB3K+3Nif0Q99g1yZUhbdxd9WWwIHhCOj9tFTediU127zifjBvT8Kp1i6dl lJXjW+4fVRMdkkENhsyrF9XeyLk3Oo4Rfh1aBnZGZRgqtkBgzj5aTktSwHFtVwrcw5CBZ3 WpykL457tZQMFtAdWfGo+wc8taAGY6A= Received: from mail-ot1-f70.google.com (mail-ot1-f70.google.com [209.85.210.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-428-vBHPPkCvP3i0G2GOBLqatA-1; Tue, 09 Jan 2024 14:27:39 -0500 X-MC-Unique: vBHPPkCvP3i0G2GOBLqatA-1 Received: by mail-ot1-f70.google.com with SMTP id 46e09a7af769-6dbfd044461so3761659a34.2 for ; Tue, 09 Jan 2024 11:27:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704828459; x=1705433259; h=content-transfer-encoding:in-reply-to:from:references: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=TNjq13Z9JNVgf+0yltHPemy7XL2lLAG7Gst1lpZmvCA=; b=AGQ+6X5iOJBOtFl2s9MySWmFg/JNkhZbNqo3zqDZEVxRW4MciBTJbVZrhulVHsphfb YfGfA3G9wSkk/UrYPhGvWBfAdt6DweHMYl5BaS1LX1OLWtOpyzdmGXEWRmkKgqbHU8pr UD8vTyIwZJRDav7x3yJHzjCAbjGHO5fWpWivR9/rU0b394hSP3tjXX9Uu3EbTkJNRk9w rb2hM1f2CWCWGBp1uqqF40yAmUUFX3EPh9tERjUqydzlSi6LDMw0ioE0ukNP9C22qyGQ qonq0EwyukPlw3sxf5jRhJNPrC2uPXb368l2UcFrlUxjGGtCAk1+SNBzCtq/gDwrhiMd w09g== X-Gm-Message-State: AOJu0Yx2zrHbMydWQk8xPKyFG05NwhEfC2tPKjRGDnjwjSV+3w5ue9vJ 8WwrY+u6K5ilixSP4+aXzrS7fe8RjELviRT0OzhOkmnwXi6bq7JNGoN7lPQTBvDuPRA7+KYJtf6 wcbX94mXUMl1aFXzN/x5tDSiA/g== X-Received: by 2002:a9d:7a59:0:b0:6dd:e17e:f714 with SMTP id z25-20020a9d7a59000000b006dde17ef714mr1511196otm.27.1704828459052; Tue, 09 Jan 2024 11:27:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IGe9L0Y1fRcnRnwHJ6NBcTG6MrxiyBEki4aWNgqpm1m0B+WS5uSWVSPtZ6NKo8D6YMm1BJ3ng== X-Received: by 2002:a9d:7a59:0:b0:6dd:e17e:f714 with SMTP id z25-20020a9d7a59000000b006dde17ef714mr1511189otm.27.1704828458819; Tue, 09 Jan 2024 11:27:38 -0800 (PST) Received: from [192.168.1.146] (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 ha11-20020a05622a2b0b00b00428031ba343sm1120688qtb.37.2024.01.09.11.27.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 09 Jan 2024 11:27:37 -0800 (PST) Message-ID: Date: Tue, 9 Jan 2024 14:27:37 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] c++: reference variable as default targ [PR101463] To: Patrick Palka , gcc-patches@gcc.gnu.org References: <20240105200116.1382389-1-ppalka@redhat.com> From: Jason Merrill In-Reply-To: <20240105200116.1382389-1-ppalka@redhat.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.6 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_H3,RCVD_IN_MSPIKE_WL,RCVD_IN_SORBS_WEB,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 1/5/24 15:01, Patrick Palka wrote: > Bootstrapped and regtested on x86_64-pc-linux-gnu, does this > look OK for trunk? > > -- >8 -- > > Here during default template argument substitution we wrongly consider > the (substituted) default arguments v and vt as value-dependent[1] > which ultimately leads to deduction failure for the calls. > > The bogus value_dependent_expression_p result aside, I noticed > type_unification_real during default targ substitution keeps track of > whether all previous targs are known and non-dependent, as is the case > for these calls. And in such cases it should be safe to avoid checking > dependence of the substituted default targ and just assume it's not. > This patch implements this optimization, which lets us accept both > testcases by sidestepping the value_dependent_expression_p issue > altogether. Hmm, maybe instead of substituting and asking if it's dependent, we should specifically look for undeduced parameters. Jason