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 8AC61385022D for ; Fri, 3 Jun 2022 15:22:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8AC61385022D Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-316-3_XW_SX9PJueo5zdiI-exg-1; Fri, 03 Jun 2022 11:22:07 -0400 X-MC-Unique: 3_XW_SX9PJueo5zdiI-exg-1 Received: by mail-qk1-f197.google.com with SMTP id l11-20020a05620a28cb00b006a67cc62878so3600374qkp.5 for ; Fri, 03 Jun 2022 08:22:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=9DzCAdc/DtoXhA1V8dwGsxanBhHhG8Ixn3ILQkteauE=; b=iXfkPZYHQChQbD1JB7HgqCl6PiAZWVu8adcqHeBytweu3u6UF9lMGtGfleRETuhgWu vz1xgmV0uecKb2eWmFWAtlD/3g1cWivbbG7Kjf1M+UmVhvnq6xrM50BQ19sxSVVGsn/l 2+rOju4RiR6IBm82GYyI40wo527xjlC6git4BK5po0hlcPqPGzOg4NqJhjExFOeNQFup 9j7jtwDpnM+H4ZDu2c2VB+mOf4Pv0NmjUZfv3VaPcGDe8lYmSZFuDvccJdl4ms9/RC5B jgLqmyVDdJelg0C2Kkm0R/XBY+3zStk3lB96UztRPjCnKH7dE/J+K3IDV0IJNG04gdp3 DdSg== X-Gm-Message-State: AOAM531UVqKue7LhT/bD7IXmq0mnKywNtBjcwl2N2nMEwDr1LtTCFjyi 1BtgK2+ehqCniqH2wkQrVhxuW98spypCw5Od+t9RAX+S5d1Um1Cryt0JG9+tk+Ezq+GraGijwnb lp/SV1ql4D1WTOyvB/A== X-Received: by 2002:a05:6214:c29:b0:45a:fedd:7315 with SMTP id a9-20020a0562140c2900b0045afedd7315mr61363382qvd.59.1654269726517; Fri, 03 Jun 2022 08:22:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwe89BrNFbp+PZCTO3c9NSLH9q+TOC6loYGTnuWa31s1dHNZWjBjHxFNGgfnlLF6GKaKsZzDg== X-Received: by 2002:a05:6214:c29:b0:45a:fedd:7315 with SMTP id a9-20020a0562140c2900b0045afedd7315mr61363363qvd.59.1654269726304; Fri, 03 Jun 2022 08:22:06 -0700 (PDT) Received: from redhat.com ([2601:184:4780:4310::9979]) by smtp.gmail.com with ESMTPSA id n2-20020a05620a294200b006a6a3f1548bsm770988qkp.54.2022.06.03.08.22.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jun 2022 08:22:05 -0700 (PDT) Date: Fri, 3 Jun 2022 11:22:03 -0400 From: Marek Polacek To: Jason Merrill Cc: Patrick Palka , gcc-patches@gcc.gnu.org Subject: Re: [PATCH] c++: cv-quals of dummy obj for non-dep memfn call [PR105637] 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 In-Reply-To: <26ffa94c-c80b-1e49-52b8-ab973a8c9317@redhat.com> User-Agent: Mutt/2.2.1 (2022-02-19) X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-6.8 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 15:22:11 -0000 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. Marek