In [dcl.ambig.res]/2 we find the following:
void foo(signed char a) {
sizeof(int(a)); // expression
sizeof(int(unsigned(a))); // type-id (ill-formed)
}
Why is int(a)
an expression and int(unsigned(a))
a type-id?
At first sight I would say that both are expressions.
int(unsigned(a))
is parsed the same as int(unsigned a)
, which is a function type
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With