From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from icp-osb-irony-out3.external.iinet.net.au (icp-osb-irony-out3.external.iinet.net.au [203.59.1.153]) by sourceware.org (Postfix) with ESMTP id E03403959C75 for ; Tue, 10 May 2022 15:48:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E03403959C75 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=netspace.net.au Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=netspace.net.au IronPort-SDR: x9E8L0uut3Q2rDZoDQmSq+LpXJu/BUFi06+Fq1fv18kLZe+y+aADAk4Yx8zoKuq1iE/jI7FShs CiLy18Q6rkiJdCdTbpBlQRr2sgFpg29Y/7GzxbISiG6bx0SXhMbkAAC4/xghxPm0+lUc9BvmgT srcOp7eURJxBIJ+ibmb/ziN4m79HtzjTRFGfdO6WmT9ridLi/k7OATuf5c5Z7pkatfE0N9ZlFv UMdgRRuVe4A62MsEGDn0ez9/pDXnDXiD9pKgOtjisYHJnPQKTTcyNdx22c4Op0ARt8ti1pUijF ar8= X-SMTP-MATCH: 1 IronPort-Data: A9a23:mB66lq6ki7l+fr4sN1W0sQxRtJfFchMFZxGqfqrLsTDasY5as4F+v mJJWDuCM/uLamb0LopwatzkpElQ6pLcx9RnSgptpH1gEysa+MHIO4+Ufxz6V8+wwm0vb67GA +E2MISowBUcFyeEzvuV3zmIQUBUjclkfJKlYAL/En03FFYMpBsJ00o5wbZk29Yw27BVPivW0 T/Mi5yHULOa82MsWo4kw/rrRMRH5amaVJsw5zTSVNgT1LPsvyB94KE3fMldG0DFrrx8RYZWc QpiIIaRpQs19z91Yj+suuqgKBVSGtY+NyDW4pZdc/DKbhRq+ndoiv5jXBYRQR8/ttmHozx+4 NhCsszvVSB1BITvxfYvCghGOA9dMJQTrdcrIVDn2SCS536fIiGqmqs+ShlwZN0tkgp1KTger bpCcGhLN0HSwbPsqF64YrAEasALNsvwPIoAkndt0SrBBP0rB5bOX+PD+Le02R9r1pEQR6yHP 5dxhTxHYQvPRABPNVAsJtEVvsW1oFDfSmRhpwfAzUYwyy2JpOBr65D2O9rKc9aiQcRTg1bdo zyW/CL+GB5yHNOTwxKe9W+2jeLQlDn2HoUIG9WFGuVC2Q3LgzZLUFhPBAr+8KP/hl+4HdNeL UEIvCwjse476SRHU+XAYvFxm1bc1jZ0ZjaaO7RSBN2lokYM3zukOw== IronPort-HdrOrdr: A9a23:g/btA6Ah/TPb4Y7lHem955DYdb4zR+YMi2TDtnoBKiC9F/byqy nAppomPHPP5Qr5O0tBpTnjAsa9qBrnnPZICOIqXItKMjOLhEKYaL5+48/D7lTbcRHDyg== X-IronPort-AV: E=Sophos;i="5.91,214,1647273600"; d="scan'208";a="389622105" Received: from 180-200-199-92.dyn.iinet.net.au (HELO [192.168.0.18]) ([180.200.199.92]) by icp-osb-irony-out3.iinet.net.au with ESMTP; 10 May 2022 23:48:51 +0800 From: Russell Shaw Subject: Re: sizeof To: gdb@sourceware.org, Andreas Schwab References: <89fec0c3-8259-4951-5478-2afe6e0f1643@simark.ca> <0bc59583-bc2f-0ca7-e5eb-6f371ca402e1@netspace.net.au> <8735hh3l98.fsf@igel.home> Message-ID: <6772c7d9-8242-2946-3a74-9e6b05f9daf8@netspace.net.au> Date: Wed, 11 May 2022 01:48:50 +1000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 May 2022 15:48:55 -0000 Andreas Schwab wrote: >On Mai 11 2022, Russell Shaw wrote: > >> On 10/5/22 5:22 pm, Andreas Schwab wrote: >>> On Mai 10 2022, Russell Shaw wrote: >>> >>>>> Andreas Schwab wrote: >>>>> On Mai 09 2022, Russell Shaw wrote: >>>>> >>>>>> sizeof(int()) should transform to sizeof(int (*)()) according to the C++20 standard. >>>>> >>>>> No, see [expr.sizeof] #3. >>>> >>>> What does "[expr.sizeof] #3" refer to ? >>> Paragrph #3 in section [expr.sizeof]. >>> "The lvalue-to-rvalue (7.3.1), array-to-pointer (7.3.2), and >>> function-to-pointer (7.3.3) standard conversions are not applied to >>> the operand of sizeof." >> >> "Standard conversions" are only applied to expressions, not type-id (which >> is an abstract declarator syntax). > >So what's the chapter and verse for your claim? It is not spelt out, but implied from the context. Clearly, the standard conversions are only a meaningful concept for expressions. "int()" is not an expression, but a type-id for a function pointer "int(*)()" so "sizeof(int())" == "size of ptr to function" unary-expression : ... sizeof unary-expression sizeof ( type-id )