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

George Burgess IV via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 12 15:57:57 PST 2021


george.burgess.iv added inline comments.


================
Comment at: clang/test/Sema/attr-diagnose-as-builtin.c:62
+
+#ifdef __cplusplus
+template <class T>
----------------
mbenfield wrote:
> george.burgess.iv wrote:
> > nit: can we also add a non-templated overload check in here?
> > 
> > if the diag isn't beautiful, that's fine IMO. just having a test-case to show the expected behavior would be nice
> Sorry, not sure what is being requested. By a "non-templated overload check" do you mean something different from `memcpy2` above?
something like the new edit suggestion below is what i have in mind :)


================
Comment at: clang/test/Sema/attr-diagnose-as-builtin.c:71
+void failure_template_instantiation(int x) __attribute__((diagnose_as_builtin(some_templated_function<int>, 1))) {} // expected-error{{'diagnose_as_builtin' attribute requires parameter 1 to be a builtin function}}
+#endif
----------------



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