================
@@ -4338,6 +4338,21 @@ bool Sema::CheckUnaryExprOrTypeTraitOperand(Expr *E,
E->getSourceRange(), ExprKind))
return true;
+ if (ExprKind == UETT_CountOf) {
+ // The type has to be an array type. We already checked for incomplete
+ // types above.
+ QualType ExprType = E->IgnoreParens()->getType();
+ if (!ExprType->isArrayType()) {
+ Diag(E->getExprLoc(), diag::err_countof_arg_not_array_type) << ExprType;
+ return true;
----------------
AaronBallman wrote:
Absolutely!
https://github.com/llvm/llvm-project/pull/133125
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits