================ @@ -9509,6 +9509,19 @@ Sema::ActOnStartRequiresExpr(SourceLocation RequiresKWLoc, PushDeclContext(BodyScope, Body); for (ParmVarDecl *Param : LocalParameters) { + if (Param->getType()->isVoidType()) { + if (LocalParameters.size() > 1) { + Diag(Param->getBeginLoc(), diag::err_void_only_param); + Param->setInvalidDecl(); + } else if (Param->getIdentifier()) { + Diag(Param->getBeginLoc(), diag::err_param_with_void_type); + Param->setInvalidDecl(); + } else if (Param->getType().hasQualifiers()) { + Diag(Param->getBeginLoc(), diag::err_void_param_qualified); + Param->setInvalidDecl(); ---------------- zyn0217 wrote:
Indeed performing a recovery would benefit source tools like clangd. Probably, we can continue as if it were an int and give up evaluating the whole expression to false - again, this is an open question, and I have no answer :D https://github.com/llvm/llvm-project/pull/109831 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits