[clang] [C2y] Implement WG14 N3369 and N3469 (_Countof) (PR #133125)

via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 27 05:08:38 PDT 2025


cor3ntin wrote:

> There is weak consensus to add `stdcountof.h` which supplies a `countof` macro. However, there's no changes to the standard which add one (yet), so I figured that can be done in a follow-up.

Then I'd really like a feature.
We already have a bunch, It makes sense to add one for that imo
```
include/clang/Basic/Features.def:FEATURE(c_alignas, LangOpts.C11)
include/clang/Basic/Features.def:FEATURE(c_alignof, LangOpts.C11)
include/clang/Basic/Features.def:FEATURE(c_atomic, LangOpts.C11)
include/clang/Basic/Features.def:FEATURE(c_generic_selections, LangOpts.C11)
include/clang/Basic/Features.def:FEATURE(c_static_assert, LangOpts.C11)
include/clang/Basic/Features.def:FEATURE(c_thread_local, LangOpts.C11 &&PP.getTargetInfo().isTLSSupported())
include/clang/Basic/Features.def:FEATURE(c_fixed_enum, LangOpts.C23)
```


https://github.com/llvm/llvm-project/pull/133125


More information about the cfe-commits mailing list