[clang] [ObjC] Enable diagnose_if on Objective-C methods (PR #115056)
Akira Hatanaka via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 20 19:32:36 PST 2024
ahatanak wrote:
> I wish I didn't need to change the ExprConstant call stack machinery like this, happy to take suggestions. This is all because the closest ancestors of FunctionDecl and ObjCMethodDecl are NamedDecl and DeclGroup.
Should we enable `diagnose_if` for block methods too?
```
void (^block)(int a) __attribute__((diagnose_if(a < 0, "cannot pass negative numbers", "error")));
```
Also is it possible or better to make `CallableDecl` an abstract base class of `FunctionDecl`, `ObjCMethodDecl` and `BlockDecl`?
https://github.com/llvm/llvm-project/pull/115056
More information about the cfe-commits
mailing list