From c54ba0bc38a2dc49d4090611c60b31aa801e000c Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Fri, 22 Mar 2024 01:06:21 -0700 Subject: doc/c23: Document typeof/typeof_unqual --- doc/c23.md | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'doc') diff --git a/doc/c23.md b/doc/c23.md index ad7ab0c..1c555b4 100644 --- a/doc/c23.md +++ b/doc/c23.md @@ -40,6 +40,16 @@ and hexadecimal, using syntax like `0b01101011`. C23 allows empty initializers to initialize an object as if it had static storage duration. +## [N2927]: Not-so-magic typeof for C + +C23 adds the `typeof(E)` type specifier to specify type of expression +`E`. Arrays and function designator expressions do not decay into +pointers, just like when used with `sizeof`. You can use a typename +with `typeof` to specify that same type. + +C23 also introduces `typeof_unqual`, which behaves the same as +`typeof` except that the specified type is unqualified. + ## [N3029]: Improved Normal Enumerations C23 allows enumerators outside the range of `int`. When an enum @@ -68,5 +78,6 @@ used inside the enum. [N2510]: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2510.pdf [N2549]: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2549.pdf [N2900]: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2900.htm +[N2927]: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2927.htm [N3029]: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3029.htm [N3030]: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3030.htm -- cgit v1.2.3