sizeof

Russell Shaw rjshaw@netspace.net.au
Tue May 10 15:43:44 GMT 2022


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


More information about the Gdb mailing list