[PATCH] D112024: [clang] diagnose_as attribute for Fortify diagnosing like builtins.

serge via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 28 00:14:13 PDT 2021


serge-sans-paille added inline comments.


================
Comment at: clang/include/clang/Basic/Attr.td:3822
+def DiagnoseAs : InheritableAttr {
+  let Spellings = [Clang<"diagnose_as">];
+  let Args = [ExprArgument<"Function">,
----------------
aaron.ballman wrote:
> george.burgess.iv wrote:
> > purely subjective nit: `diagnose_as` feels a bit too generic. if you agree, does `diagnose_as_builtin` sound potentially better?
> Agreed on it being a bit generic -- it sounds like this is only useful for Fortify, so I wonder if I'm wrong about that or whether we should name it `fortify_diagnose_as_builtin` or `fortify_diagnostic`, etc.
(Jumping in a  bit late) I second the `diagnose_as_builtin` name. But then we should check that the attribute is only set on inline builtin declaration (as in `Decl::isInlineBuiltinDeclaration`) and state so in the documentation.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112024



More information about the cfe-commits mailing list