[clang] Add more tests for _Countof (PR #133333)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 8 05:19:48 PDT 2025


================
@@ -144,3 +177,13 @@ void test_compound_literals() {
   static_assert(_Countof((int[2]){}) == 2);
   static_assert(_Countof((int[]){1, 2, 3, 4}) == 4);	
 }
+
+static int test_f1();
+static int test_f2();  // expected-warning {{never defined}}
----------------
AaronBallman wrote:

> It seems it's not triggering anything at all. :|

Yeah, I would turn that comment into a FIXME about how we *should* get the diagnostic but it's a bug that we don't.

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


More information about the cfe-commits mailing list