From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by sourceware.org (Postfix) with ESMTP id 5C10A3887015 for ; Mon, 22 Jun 2020 18:55:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5C10A3887015 Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-362-3nrNSdNUOfuoSa0HN1luPQ-1; Mon, 22 Jun 2020 14:55:08 -0400 X-MC-Unique: 3nrNSdNUOfuoSa0HN1luPQ-1 Received: by mail-qt1-f199.google.com with SMTP id k23so14009547qtb.2 for ; Mon, 22 Jun 2020 11:55:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=xABWLxnqtZDZx+N6kV9W3LyZV37DkXnZsqATxYlcZWE=; b=NNm814VKug4Zve/ABgcwjJ7ln4/eD4Lza73k7f9XLJqq+fGj6ehAFsGhjI+2uKSvxP v+jtXigwbcijUVDYgZR/xMFh9emixOJc7n7ukEY8GxdO+bmcu9Jl56JI7eQFyYatGQRy ROpsaZoSA6+IcwDACSL+jY2B38Njeyy601KYD8SWqeGU+DkhXpHCknvLrDgrz74dXk0U 5CXhIrWacMI79ZcguqHt8kB3907J0pBV422u/UBjKeSE6YAghBWMvRIfesvt0w9DwcxC 2InPXl//KveOM+22cIhKsepsPoQqaoBWF1lm4OM0fCXqW41Erdxzu+aCiZ1KYeMAZiR4 x3wA== X-Gm-Message-State: AOAM532Xtplr9X6SpVS11TLzoDRAJDjX+p8Wv2FABPpvHngagLV7eNyy YrNTnI3KcmW+6MPdLYzjt1bHd5MMA6uc7VVk0ITNiqS6LXmRg++yiOAKlKFtBKDzdlA9UpWGxk+ RdO2iqTWnIR/iKUNpmQ== X-Received: by 2002:ac8:4e08:: with SMTP id c8mr10453563qtw.299.1592852107927; Mon, 22 Jun 2020 11:55:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKUJLnuHvXPDYHoth26uhcnoi2qQMEYcz78P6Sbpfxo+rmtNZW4+WyMPO7UZCBq8Vo1tOj1g== X-Received: by 2002:ac8:4e08:: with SMTP id c8mr10453541qtw.299.1592852107626; Mon, 22 Jun 2020 11:55:07 -0700 (PDT) Received: from [192.168.1.148] (209-6-216-142.s141.c3-0.smr-cbr1.sbo-smr.ma.cable.rcncustomer.com. [209.6.216.142]) by smtp.gmail.com with ESMTPSA id s15sm16684675qtc.95.2020.06.22.11.55.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 22 Jun 2020 11:55:07 -0700 (PDT) Subject: Re: [PATCH] handle MEM_REF with void* arguments (PR c++/95768) To: Martin Sebor , gcc-patches References: From: Jason Merrill Message-ID: Date: Mon, 22 Jun 2020 14:55:06 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.5 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, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Mon, 22 Jun 2020 18:55:12 -0000 On 6/22/20 1:25 PM, Martin Sebor wrote: > The attached fix parallels the one for the equivalent C bug 95580 > where the pretty printers don't correctly handle MEM_REF arguments > with type void* or other pointers to an incomplete type. > > The incorrect handling was exposed by the recent change to > -Wuninitialized which includes such expressions in diagnostics. > + if (tree size = TYPE_SIZE_UNIT (TREE_TYPE (argtype))) > + if (!integer_onep (size)) > + { > + pp_cxx_left_paren (pp); > + dump_type (pp, ptr_type_node, flags); > + pp_cxx_right_paren (pp); > + } Don't we want to print the cast if the pointer target type is incomplete? Jason