[PATCH] D112579: Allow non-variadic functions to be attributed with `__attribute__((format))`

FĂ©lix Cloutier via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 5 09:31:11 PDT 2022


fcloutier added a comment.

I'm afraid that's also not possible: `D` is a `Decl`, so it doesn't have `getType()`. `Decl` is the tightest-fitting superclass of `BlockDecl`, `FunctionDecl` and `ObjCMethodDecl` (because `BlockDecl` is a direct subclass of it).

One option could be to cast the `Decl` to a `FunctionDecl` and then use `FDecl->isVariadic()`, similarly to how it goes for `BlockDecl` and `ObjCMethodDecl`. I'm not sure that it's equivalent, but if you believe it is and like it better, I can do that.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112579/new/

https://reviews.llvm.org/D112579



More information about the cfe-commits mailing list