public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Russell Shaw <rjshaw@netspace.net.au>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: gdb@sourceware.org
Subject: Re: sizeof
Date: Wed, 11 May 2022 00:20:38 +1000	[thread overview]
Message-ID: <dc776675-488f-52f7-3b67-9ccf8c59fcca@netspace.net.au> (raw)
In-Reply-To: <8735hh3l98.fsf@igel.home>

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.

  reply	other threads:[~2022-05-10 14:20 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-08 15:22 sizeof Russell Shaw
2022-05-08 17:29 ` sizeof Simon Marchi
2022-05-08 17:48   ` sizeof Andreas Schwab
2022-05-09  7:21   ` sizeof Russell Shaw
2022-05-09  7:35     ` sizeof Andreas Schwab
2022-05-10  3:46     ` sizeof Russell Shaw
2022-05-10  7:22       ` sizeof Andreas Schwab
2022-05-10 14:20         ` Russell Shaw [this message]
2022-05-10 14:48           ` sizeof Andreas Schwab
2022-05-10 15:43           ` sizeof Russell Shaw
2022-05-10 15:48           ` sizeof Russell Shaw
2022-05-10 16:06             ` sizeof Andreas Schwab
2022-05-11  5:38             ` sizeof Russell Shaw
2022-05-11  8:16               ` sizeof Russell Shaw
2022-05-11 17:44                 ` sizeof Russell Shaw

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dc776675-488f-52f7-3b67-9ccf8c59fcca@netspace.net.au \
    --to=rjshaw@netspace.net.au \
    --cc=gdb@sourceware.org \
    --cc=schwab@linux-m68k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).