[clang] Add more tests for _Countof (PR #133333)
Alejandro Colomar via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 28 07:16:08 PDT 2025
================
@@ -102,6 +126,11 @@ void test_unspecified_array_length() {
static_assert(_Countof(**x) == 3);
}
+void test_completed_array() {
+ int a[] = {1, 2, global_num};
+ static_assert(_Countof(a) == 3);
----------------
alejandro-colomar wrote:
Or maybe it's because it was using `errno`, which didn't allow it to be completed. Maybe it now works.
https://github.com/llvm/llvm-project/pull/133333
More information about the cfe-commits
mailing list