================
@@ -35,6 +35,8 @@ void test_semantic_failures() {
int non_array;
(void)_Countof non_array; // expected-error {{'_Countof' requires an
argument of array type; 'int' invalid}}
(void)_Countof(int); // expected-error {{'_Countof' requires an
argument of array type; 'int' invalid}}
+ (void)_Countof(void); // expected-error {{invalid application of
'_Countof' to an incomplete type 'void'}}
+ int arr2[_Countof(void)]; // expected-error {{invalid application of
'_Countof' to an incomplete type 'void'}}
----------------
AaronBallman wrote:
One more test we should consider is with an expression operand rather than a
type operand:
```
void *vp = &non_array;
(void)_Countof(*vp); // error, applied to incomplete type void
```
https://github.com/llvm/llvm-project/pull/181169
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits