[PATCH] D24886: Add [[clang::suppress(rule, ...)]] attribute

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 11 10:14:51 PDT 2016


aaron.ballman added inline comments.


================
Comment at: include/clang/Basic/Attr.td:1469
+  let Spellings = [CXX11<"clang", "suppress">, CXX11<"gsl", "suppress">];
+  let Args = [VariadicStringArgument<"Rules">];
+  let Documentation = [SuppressDocs];
----------------
Perhaps we should name this something other than "Rules" -- you don't suppress a rule, you're suppressing a diagnostic based on some identifier, so I'd go with `DiagnosticIdentifiers` or something along those lines.


================
Comment at: include/clang/Basic/AttrDocs.td:2509
+to suppress specific clang-tidy warnings. They can be attached to a scope,
+statement or type. The ``[[gsl::suppress]]`` is an alias of ``[[clang::suppress]]``
+which is intended to be used for suppressing rules of the C++ Core Guidelines_
----------------
This statement does not match the test cases -- it does not appear to be possible to attach the attribute to a type.


https://reviews.llvm.org/D24886





More information about the cfe-commits mailing list