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 55415385355B for ; Fri, 3 Jun 2022 16:04:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 55415385355B Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-401-LzWqOgGBNii794BznKoLIA-1; Fri, 03 Jun 2022 12:04:07 -0400 X-MC-Unique: LzWqOgGBNii794BznKoLIA-1 Received: by mail-qt1-f197.google.com with SMTP id g14-20020ac87d0e000000b00304c6e43d12so6018465qtb.0 for ; Fri, 03 Jun 2022 09:04:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:mime-version; bh=g4g4VYOV6jz4og4vIAZn2pb6LWis2KWAq2rXVH/b6SA=; b=5/WLhDbeZ1M+nqV/O1gphk0F5Mr7B8VqJ57whkdayjno5U51QHDwK3Q1jtIgU9xqEc vwRCRaeHrptT9QPOo4LcgIm5UOtsZow6P+XVM9c6kYFeY8iv3UR7mAMKb5e0niSWqsEw tuAK8FdC7zRPfKGGPEqdVOJac7ZY8jvLSfq5tKLEnaZDd6LIyd+5nkR1Bpvizi41MPP+ EdVo1PPO31SDi16Xpi3nwEkbE4vIdIdm3topgH3TJ3cbMohtqbBUJhfYdWen+aKLZX0C F4jdCRcXtJs+utz3oZGVeLA4THsqqTfJ/PdRQgKFM7dAm2DTjlDyvbVxZCUgqg93JLb7 Z6ww== X-Gm-Message-State: AOAM530ZG13tnuLmPi9rVeZLQpAKOKShtPAHx/Nw8swOt+5GgPlXm6a7 etd8vc0jLTvFCED9bZx1zGFy8EjxeC6MG/fUyjDfI3Cwym4VriLPjSMppxD5RxxyNYRsKRPwjE3 pJU3b9eeMEnW8JNe96w== X-Received: by 2002:a05:6214:d8b:b0:461:f7a4:5292 with SMTP id e11-20020a0562140d8b00b00461f7a45292mr62705659qve.96.1654272246315; Fri, 03 Jun 2022 09:04:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXnjt0RFwhxvDnfgwEVzgNgBgthW5vmxWvQ5R6D1FkLrgxHvFr7YTbJKLYWQvKt0TrUaOsGw== X-Received: by 2002:a05:6214:d8b:b0:461:f7a4:5292 with SMTP id e11-20020a0562140d8b00b00461f7a45292mr62705625qve.96.1654272245897; Fri, 03 Jun 2022 09:04:05 -0700 (PDT) Received: from [192.168.1.130] (ool-457670bb.dyn.optonline.net. [69.118.112.187]) by smtp.gmail.com with ESMTPSA id l186-20020a3789c3000000b006a37710ef89sm5550495qkd.115.2022.06.03.09.04.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jun 2022 09:04:05 -0700 (PDT) From: Patrick Palka X-Google-Original-From: Patrick Palka Date: Fri, 3 Jun 2022 12:04:04 -0400 (EDT) To: Marek Polacek cc: Jason Merrill , Patrick Palka , gcc-patches@gcc.gnu.org Subject: Re: [PATCH] c++: cv-quals of dummy obj for non-dep memfn call [PR105637] In-Reply-To: Message-ID: References: <34d2cabf-523c-098d-633d-8e3d7619f8b1@redhat.com> <1874d5e6-8a87-2b90-d9a2-95be5831af16@idea> <0fcce048-5e2c-4071-43e3-20f9fb72ba52@redhat.com> <7b8d13d3-cdab-a749-287a-8770e7f00d41@redhat.com> <987d0020-69d8-b2d6-17f0-7cfd4d952f31@idea> <26ffa94c-c80b-1e49-52b8-ab973a8c9317@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-8.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jun 2022 16:04:09 -0000 On Fri, 3 Jun 2022, Marek Polacek wrote: > On Fri, Jun 03, 2022 at 11:16:26AM -0400, Jason Merrill via Gcc-patches wrote: > > On 6/3/22 11:04, Patrick Palka wrote: > > > > > @@ -4319,15 +4319,32 @@ maybe_dummy_object (tree type, tree* binfop) > > > > > if (binfop) > > > > > *binfop = binfo; > > > > > - if (current_class_ref > > > > > - /* current_class_ref might not correspond to current_class_type if > > > > > - we're in tsubst_default_argument or a lambda-declarator; in either > > > > > - case, we want to use current_class_ref if it matches CONTEXT. */ > > > > > - && (same_type_ignoring_top_level_qualifiers_p > > > > > - (TREE_TYPE (current_class_ref), context))) > > > > > + /* current_class_ref might not correspond to current_class_type if > > > > > + we're in tsubst_default_argument or a lambda-declarator; in either > > > > > + case, we want to use current_class_ref if it matches CONTEXT. */ > > > > > + tree ctype = current_class_ref ? TREE_TYPE (current_class_ref) : > > > > > NULL_TREE; > > > > > + if (ctype > > > > > + && same_type_ignoring_top_level_qualifiers_p (ctype, context)) > > > > > decl = current_class_ref; > > > > > else > > > > > - decl = build_dummy_object (context); > > > > > + { > > > > > + /* Return a dummy object whose cv-quals are consistent with (the > > > > > + non-lambda) 'this' if available. */ > > > > > + if (ctype) > > > > > + { > > > > > + int quals = 0; > > Sorry to nitpick, but this 0 could be TYPE_UNQUALIFIED. Good point, fixed. > > Marek > >