C2x features status
Joseph Myers
joseph@codesourcery.com
Fri Oct 21 22:19:07 GMT 2022
On Fri, 21 Oct 2022, Florian Weimer wrote:
> > while typeof was enabled by default for -std=gnu* anyway
> > in previous releases so is a lower risk.
>
> Do the semantics of typeof change to align with C++, so that typeof
> (int) becomes invalid?
No. Both typeof (expr) and typeof (type) are valid.
The changes to make typeof (expr) consistently avoid returning a qualified
or atomic type when passed an rvalue argument (while preserving qualifiers
on lvalues) mostly went into previous releases, but I found and fixed a
few more cases when implementing standard typeof (and all those fixes are
unconditional).
typeof in C2x mode does not treat const or noreturn function attributes as
part of the type of a function or function pointer, unlike typeof in
previous modes and __typeof even in C2x mode.
--
Joseph S. Myers
joseph@codesourcery.com
More information about the Gcc
mailing list