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

2017-10-30 Thread Aaron Ballman via cfe-commits
On Sun, Oct 29, 2017 at 4:42 AM, Hristo Hristov via Phabricator wrote: > roccoor added a comment. > > Microsoft supports: > > [[gsl::suppress(bounds.3)]] > > Clang requires: > > [[gsl::suppress("bounds.3")]] > > Why is this inconsistency? I believe that when we added this attribute, MSVC did

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

2017-10-29 Thread Hristo Hristov via Phabricator via cfe-commits
roccoor added a comment. Microsoft supports: [[gsl::suppress(bounds.3)]] Clang requires: [[gsl::suppress("bounds.3")]] Why is this inconsistency? Here is an example from CppCoreGuidelines [[suppress(bounds)]] char* raw_find(char* p, int n, char x)// find x in p[0]..p[n - 1] {

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

2017-04-18 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: cfe/trunk/include/clang/Basic/AttrDocs.td:2792 + namespace N { +[[clang::suppress("type", "bounds")]]; +... Should this be `gsl::suppress` as well? Repository: rL LLVM https://reviews.llvm.org/D24886

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

2017-03-27 Thread Matthias Gehre via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL298880: Add [[clang::suppress(rule, ...)]] attribute (authored by mgehre). Changed prior to commit: https://reviews.llvm.org/D24886?vs=93055&id=93168#toc Repository: rL LLVM https://reviews.llvm.org

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

2017-03-26 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM! https://reviews.llvm.org/D24886 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman

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

2017-03-25 Thread Matthias Gehre via Phabricator via cfe-commits
mgehre updated this revision to Diff 93055. mgehre added a comment. Added test to misc; minor wording https://reviews.llvm.org/D24886 Files: include/clang/Basic/Attr.td include/clang/Basic/AttrDocs.td lib/Sema/SemaDeclAttr.cpp lib/Sema/SemaStmtAttr.cpp test/Misc/ast-dump-attr.cpp te

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

2017-03-24 Thread Matthias Gehre via Phabricator via cfe-commits
mgehre updated this revision to Diff 92923. mgehre added a comment. Thank you for the comments; all of them have been addressed. https://reviews.llvm.org/D24886 Files: include/clang/Basic/Attr.td include/clang/Basic/AttrDocs.td lib/Sema/SemaDeclAttr.cpp lib/Sema/SemaStmtAttr.cpp test/

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

2017-03-19 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. I'd also like to see some tests in Misc that confirm the attribute is being attached to the appropriate AST nodes for declarations, statements, and at namespace scope. Comment at: include/clang/Basic/Attr.td:1527 +def Suppress : StmtAttr { + le

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

2017-03-17 Thread Matthias Gehre via Phabricator via cfe-commits
mgehre updated this revision to Diff 92211. mgehre marked an inline comment as done. mgehre added a comment. Update for review comments https://reviews.llvm.org/D24886 Files: include/clang/Basic/Attr.td include/clang/Basic/AttrDocs.td lib/Sema/SemaDeclAttr.cpp lib/Sema/SemaStmtAttr.cpp

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

2016-10-26 Thread Aaron Ballman via cfe-commits
aaron.ballman added inline comments. 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 fo

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

2016-10-23 Thread Matthias Gehre via cfe-commits
mgehre added inline comments. 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 suppr

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

2016-10-11 Thread Aaron Ballman via cfe-commits
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

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

2016-09-28 Thread Matthias Gehre via cfe-commits
mgehre added a comment. My main goal is to be able to suppress any clang-tidy warning through an attribute. Initially, I though we could reuse the C++ Core Guidelines attribute for that, (because I though it was plain [[suppress]]). As a bonus (not more), we would have interoperability with oth

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

2016-09-28 Thread Matthias Gehre via cfe-commits
mgehre added a comment. In the C++ Core Guidelines issue on namespaceing of the [[suppress]], it was state that Microsoft uses [[gsl::suppress]] and it is the intent to update the C++ Core Guidelines to [[gsl::suppress]]. https://reviews.llvm.org/D24886 _

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

2016-09-27 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added a subscriber: malcolm.parsons. malcolm.parsons added a comment. In https://reviews.llvm.org/D24886#554130, @mgehre wrote: > 2. Also, I suspect we will want this attribute to also be written on types I > was thinking about a case were that was useful, and didn't find any. Wh

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

2016-09-27 Thread Aaron Ballman via cfe-commits
aaron.ballman added a comment. In https://reviews.llvm.org/D24886#554130, @mgehre wrote: > Thank your very much for your comments! > Let me try to give me reasoning for those points: > > 1. But it's missing some pieces, like test cases I though about how to test > this, having no semantic meani

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

2016-09-27 Thread Matthias Gehre via cfe-commits
mgehre added a comment. Thank your very much for your comments! Let me try to give me reasoning for those points: 1. But it's missing some pieces, like test cases I though about how to test this, having no semantic meaning itself. I could look at the AST dump, but it does not even show the rules

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

2016-09-26 Thread Aaron Ballman via cfe-commits
aaron.ballman added a comment. In https://reviews.llvm.org/D24886#552859, @rsmith wrote: > Giving this the name `[[clang::suppress(...)]]` seems unhelpful. This > attribute is specified by the C++ core guidelines, not by clang, and > presumably we want code using this attribute to be portable a

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

2016-09-26 Thread Richard Smith via cfe-commits
rsmith added a comment. Giving this the name `[[clang::suppress(...)]]` seems unhelpful. This attribute is specified by the C++ core guidelines, not by clang, and presumably we want code using this attribute to be portable across implementations of the C++ code guidelines. I'd suggest asking th

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

2016-09-26 Thread Aaron Ballman via cfe-commits
aaron.ballman requested changes to this revision. aaron.ballman added a comment. This revision now requires changes to proceed. I'm generally in favor of this patch, but it's missing some pieces, like test cases. Also, I suspect we will want this attribute to also be written on types, but there

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

2016-09-23 Thread Matthias Gehre via cfe-commits
mgehre updated this revision to Diff 72366. mgehre added a comment. Include link to corresponding clang-tidy patch https://reviews.llvm.org/D24886 Files: include/clang/Basic/Attr.td lib/Sema/SemaDeclAttr.cpp lib/Sema/SemaStmtAttr.cpp Index: lib/Sema/SemaStmtAttr.cpp =

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

2016-09-23 Thread Matthias Gehre via cfe-commits
mgehre created this revision. mgehre added reviewers: alexfh, aaron.ballman, rsmith. mgehre added a subscriber: cfe-commits. This patch implements parsing of [[clang::suppress(rule, ...)]] attributes. C++ Core Guidelines depend heavily on tool support for rule enforcement. They also propose a way