[clang] [C2y] Implement WG14 N3369 and N3469 (_Countof) (PR #133125)
A. Jiang via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 27 01:41:26 PDT 2025
================
@@ -141,6 +141,12 @@ C2y Feature Support
paper also introduced octal and hexadecimal delimited escape sequences (e.g.,
``"\x{12}\o{12}"``) which are also supported as an extension in older C
language modes.
+- Implemented `WG14 N3369 <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3369.pdf>`_
+ which introduces the ``_Lengthof`` operator, and `WG14 N3469 <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3469.htm>`_
+ which renamed ``_Lengthof`` to ``_Countof``. This feature is implemented as
+ a conforming extension in earlier C language modes, but not in C++ language
+ modes (``std::extent`` and ``std::rank`` already provide the same
----------------
frederick-vs-ja wrote:
```suggestion
modes (``std::extent`` and ``std::size`` already provide the same
```
I guess it's better to say `std::size` (which gets the count of built-in array values) here, as `_Countof` doesn't get the rank of an array.
https://github.com/llvm/llvm-project/pull/133125
More information about the cfe-commits
mailing list