================
@@ -1711,6 +1711,13 @@ void SemaObjC::handleBlocksAttr(Decl *D, const
ParsedAttr &AL) {
return;
}
+ VarDecl *VD = dyn_cast<VarDecl>(D);
+ if (!VD || !VD->hasLocalStorage()) {
+ Diag(AL.getLoc(), diag::err_block_on_nonlocal) << AL;
+ D->setInvalidDecl();
----------------
zwuis wrote:
We can remove marking it as invalid for better error recovery.
https://github.com/llvm/llvm-project/pull/183988
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits