From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from icp-osb-irony-out6.external.iinet.net.au (icp-osb-irony-out6.external.iinet.net.au [203.59.1.106]) by sourceware.org (Postfix) with ESMTP id E5D533954402 for ; Tue, 10 May 2022 14:20:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E5D533954402 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: 8TrrfrSH6HrGFXPxJ2s1aobC4mvlMUBuKQcRJVTJoE7YC5uyBmHLsf8ekxZfmj0dX/tuQYTBkr hWMgB7LjZI72Hu9PyqRCL7J3vmHD5ggoi59cy9el/N/J8mx13fKuqjVG09toqHalg8DwJLvnVn tsHBCMmlWXcZRfn0HMln9sMVnzIE32OH7Eh26P0ZLFQy3LEStDRoSsBcYR/3FCrlgO4NwqbvWf PgSbU/2RQ1VztEm9xxMs7H3/mPgfhCaUHU8G8gaf5/8GAvO4Utqu3/yBATZ7fbM7LafQaamkI4 zeU= X-SMTP-MATCH: 1 IronPort-Data: A9a23:coSCh6I0ErMF4/zjFE+RfpclxSXFcZb7ZxGr2PjKsXjdYENShmYGx jAZCG2FMqyJNzfzKt5wYNzk8UoF7Z7Wm4Q2TQBorCE8RH908seUXt7xwmUcn8+xwmwvaGo9s q3yv/GZdJhcokcxJ35BC5C5xZVG/fjgqoHUVaiVY0ideSc+EH170U86w7Zj6mJVqYPR7z2l6 IuaT/L3ZQfNNw5cagr4PIra9XuDFNyr0N8plgRWicJj5TcypFFMZH4rHpxdGlOjKmVi8k9Wc M6YpF2x1juxEx4FVoj/yu6jGqEAaua60QOm0hK6V4D+2UIa/nRaPqsTbJIhhUlrZzqhkPVNz 9Mdk5mJZwYNFKnOn+pGUwVnKnQrVUFG0OevzXmXgpXClQufLSuqm7M3XHRe0Y8wo7YvRzsWr bpBeWFLP0rra+GemdpXTsF2hN8jJdbDOo4DoWlpxjyfC/s6B5neK0nPzYQGhmdu154eTZ4yY eIAbwE3RT2Qfyd+P2tUJK4grb24j1fgJmgwRFW94PBfD3Lo5AN92pD2N8fPcdGVTN9Y2EGCq Qru5G/5HRgQHNiezyeVt3fy1uyJmjn0ML/+D5XhpqYv2gXLgzVCWVhHDx23sP//i0+4Vs4ZL UEIvCMzxUQvyHGWohDGd0XQiBa5UtQ0ArK8z8VSBNmx95fp IronPort-HdrOrdr: A9a23:Ev6uRqnoM3/GyxAmZY+haCxETATpDfIu3DAbv31ZSRFFG/Fw8P re+8jztCWE7Ar5PUtKpTnuAsa9qAPnn6KdjbN9AV7aZniChILKFuFfBOnZsl/d8kTFn4ZgPM FbEpSWY+edMbEVt6jHCEvRKadC/OW6 X-IronPort-AV: E=Sophos;i="5.91,214,1647273600"; d="scan'208";a="362869688" Received: from 180-200-199-92.dyn.iinet.net.au (HELO [192.168.0.18]) ([180.200.199.92]) by icp-osb-irony-out6.iinet.net.au with ESMTP; 10 May 2022 22:20:40 +0800 Subject: Re: sizeof To: Andreas Schwab Cc: gdb@sourceware.org References: <89fec0c3-8259-4951-5478-2afe6e0f1643@simark.ca> <0bc59583-bc2f-0ca7-e5eb-6f371ca402e1@netspace.net.au> <8735hh3l98.fsf@igel.home> From: Russell Shaw Message-ID: Date: Wed, 11 May 2022 00:20:38 +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: <8735hh3l98.fsf@igel.home> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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 14:20:50 -0000 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). 7.6.2.5 Sizeof [expr.sizeof] 3) only applies to the first case "sizeof unary-expression", not the second "sizeof ( type-id )". unary-expression : ... sizeof unary-expression sizeof ( type-id ) ************** 7.6.2.5 Sizeof [expr.sizeof] 3) The lvalue-to-rvalue (7.3.2), array-to-pointer (7.3.3), and function-to-pointer (7.3.4) standard conversions are not applied to the operand of sizeof. If the operand is a prvalue, the temporary materialization conversion (7.3.5) is applied. ************** 7.3 Standard conversions [conv] 7.3.1 General [conv.general] A standard conversion sequence will be applied to an expression if necessary to convert it to a required destination type. ************** I don't seem to get all replies on the gdb list so i'm including your email in case you don't get all replies either. I have to check the gdb web page archive.