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 6C7BB3857357 for ; Thu, 26 Oct 2023 20:54:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6C7BB3857357 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 6C7BB3857357 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698353676; cv=none; b=TqbYQ41fqViWlfPCEEvQOZTsqziuJ9zANCLqdLRLdZ/PG5badNOIMLKHOmvsLcOB/RN7xJMhQE4dA4Vt0+jPZFHpw6lrWplqxJMu/bipv0ntFMb9AlaSyl/ai21qsDaIZc4rFVIj5clGP4KXoyXAe9YeQVSRnfDLZjMJJL3B8vc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698353676; c=relaxed/simple; bh=jrKJ7gkaG57JxtdQwhGoCVD+LoYT1WXBEwCMo2W+BFQ=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=pTovVWFLN8Uuy85xHD6p0Ge8OSTFSIKkVlPzWO0dZDUyxDG8MeoB9DWZJsXRCc47t7Pw6s81pl36aciEtdHfwuFG45u9juUXDb2U/mE7rKvd/rvJPwyHG/2OLGHhZUNZ0ARHUNU5FABKaQ9o5C6078a4s2GIpcMXq5OMVu3Y49A= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698353675; 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=egUtKEqaP0BMEYw0RIrXyXsvLWFpLAP+1rrKmGCkhAM=; b=HiTHNXUKjS7J4VK6E1Eg02yorItKGGNgrvsUtHAzhsY9nQAH14gh99eexpxw7NiFVdRXJ8 5CGLT1tmy6DHhLxvyo7WIl33P8occ/AO53vRuvRS4pNRdh8zBKJr2EGgWIDy/SP1Mc1Qgu qrKL8x+JAXIsKDLHWFGXNaM6RZn5upQ= 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.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-333-Q4k0RNsKNRuuEccx256poA-1; Thu, 26 Oct 2023 16:54:23 -0400 X-MC-Unique: Q4k0RNsKNRuuEccx256poA-1 Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-778b5445527so354230985a.1 for ; Thu, 26 Oct 2023 13:54:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698353663; x=1698958463; 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=egUtKEqaP0BMEYw0RIrXyXsvLWFpLAP+1rrKmGCkhAM=; b=kV3F+h0j6Kky879IJnTs+1tb4NXWtmkXwyiOrRx8Fp4R0z7p0JyZndw2n1Xgk+PGVt 8XJ8t1CmUm66XoWF7u1OetW0Cwl61JmF9AnDeVisRVNR9IT7yHQ5Vii9Vmpx/rGFnsyv vLkB47o3APAC/fNAlxi8/EV0fPx99JmAYmeEgQnpuYaAOX+cP1sySBNtaXeM96miCV/4 KixQhnLgEall51W6TGmgGpWc15qKp9B6aejVMHWBvrW7iCeFWKhtFjNJ9SQL/Bp/52kO jogUfx6YA+peSh3WURys807GjgsdxXo0+3/ONOdPugwCCrxSJ4zIbAcfrqEKFLvicW2O 82+A== X-Gm-Message-State: AOJu0YwYuSFvvA5IaOf/laA9eM2Qn4oQHEV+GQtGv5+6HftfrYzKKQfA hIls2zJHFs2h51HC6URWtOuO2HsqhO8fBTAh1GXfsBNhACMWs9QilZLWSpTxzaUqjm7PB35zPv5 SSJUpdG7OUjDINFKGOvWNUSiLbA== X-Received: by 2002:a05:620a:2442:b0:774:e4e:34d with SMTP id h2-20020a05620a244200b007740e4e034dmr1221899qkn.33.1698353662878; Thu, 26 Oct 2023 13:54:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFUk83GG3KzaSbdCGq2GcklBWTiwF905a1/esvCuZuQMeVbzrZWDUWX73QEYnSgQYQxPcfONg== X-Received: by 2002:a05:620a:2442:b0:774:e4e:34d with SMTP id h2-20020a05620a244200b007740e4e034dmr1221886qkn.33.1698353662582; Thu, 26 Oct 2023 13:54:22 -0700 (PDT) Received: from [192.168.1.108] (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 pa39-20020a05620a832700b0076f058f5834sm24636qkn.61.2023.10.26.13.54.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 26 Oct 2023 13:54:21 -0700 (PDT) Message-ID: Date: Thu, 26 Oct 2023 16:54:20 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] c++: more ahead-of-time -Wparentheses warnings To: Patrick Palka , gcc-patches@gcc.gnu.org References: <20231025185556.844718-1-ppalka@redhat.com> From: Jason Merrill In-Reply-To: <20231025185556.844718-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.4 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 10/25/23 14:55, Patrick Palka wrote: > Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look > OK for trunk? > > -- >8 -- > > Now that we don't have to worry about looking thruogh NON_DEPENDENT_EXPR, > we can easily extend the -Wparentheses warning in convert_for_assignment > to consider (non-dependent) templated assignment operator expressions as > well, like r14-4111-g6e92a6a2a72d3b did in maybe_convert_cond. > > gcc/cp/ChangeLog: > > * cp-tree.h (is_assignment_op_expr_p): Declare. > * semantics.cc (is_assignment_op_expr_p): Generalize to return > true for assignment operator expression, not just one that > have been resolved to an operator overload. > (maybe_convert_cond): Remove now-redundant checks around > is_assignment_op_expr_p. > * typeck.cc (convert_for_assignment): Look through implicit > INDIRECT_REF in -Wparentheses warning logic, and generalize > to use is_assignment_op_expr_p. Do we want to factor out the whole warning logic rather than adjust it in both places? Jason