[clang-tools-extra] r366265 - [clang-tidy] initial version of readability-convert-member-functions-to-static

2019-07-16 Thread Matthias Gehre via cfe-commits
Author: mgehre Date: Tue Jul 16 14:19:00 2019 New Revision: 366265 URL: http://llvm.org/viewvc/llvm-project?rev=366265&view=rev Log: [clang-tidy] initial version of readability-convert-member-functions-to-static Summary: Finds non-static member functions that can be made ``static``. I have run t

r367040 - Add lifetime categories attributes

2019-07-25 Thread Matthias Gehre via cfe-commits
Author: mgehre Date: Thu Jul 25 10:50:51 2019 New Revision: 367040 URL: http://llvm.org/viewvc/llvm-project?rev=367040&view=rev Log: Add lifetime categories attributes Summary: This is the first part of work announced in "[RFC] Adding lifetime analysis to clang" [0], i.e. the addition of the [[gs

r368147 - gsl::Owner/gsl::Pointer: Add implicit annotations for some std types

2019-08-07 Thread Matthias Gehre via cfe-commits
Author: mgehre Date: Wed Aug 7 03:45:36 2019 New Revision: 368147 URL: http://llvm.org/viewvc/llvm-project?rev=368147&view=rev Log: gsl::Owner/gsl::Pointer: Add implicit annotations for some std types Summary: Hard code gsl::Owner/gsl::Pointer for std types. The paper mentions some types explici

r368929 - [LifetimeAnalysis] Support std::stack::top() and std::optional::value()

2019-08-14 Thread Matthias Gehre via cfe-commits
Author: mgehre Date: Wed Aug 14 14:55:57 2019 New Revision: 368929 URL: http://llvm.org/viewvc/llvm-project?rev=368929&view=rev Log: [LifetimeAnalysis] Support std::stack::top() and std::optional::value() Summary: Diagnose dangling pointers that come from std::stack::top() and std::optional::val

[clang-tools-extra] r364106 - [clang-tidy] misc-unused-parameters: don't comment out parameter name for C code

2019-06-21 Thread Matthias Gehre via cfe-commits
Author: mgehre Date: Fri Jun 21 14:30:25 2019 New Revision: 364106 URL: http://llvm.org/viewvc/llvm-project?rev=364106&view=rev Log: [clang-tidy] misc-unused-parameters: don't comment out parameter name for C code Summary: The fixit `int square(int /*num*/)` yields `error: parameter name omitted

[clang-tools-extra] r360613 - [clang-tidy] readability-redundant-declaration: fix false positive with C "extern inline"

2019-05-13 Thread Matthias Gehre via cfe-commits
Author: mgehre Date: Mon May 13 12:21:57 2019 New Revision: 360613 URL: http://llvm.org/viewvc/llvm-project?rev=360613&view=rev Log: [clang-tidy] readability-redundant-declaration: fix false positive with C "extern inline" Summary: readability-redundant-declaration was diagnosing a redundant dec

[clang-tools-extra] r360698 - [clang-tidy] Fix invalid fixit for readability-static-accessed-through-instance (bug 40544)

2019-05-14 Thread Matthias Gehre via cfe-commits
Author: mgehre Date: Tue May 14 11:23:10 2019 New Revision: 360698 URL: http://llvm.org/viewvc/llvm-project?rev=360698&view=rev Log: [clang-tidy] Fix invalid fixit for readability-static-accessed-through-instance (bug 40544) Summary: Fixed https://bugs.llvm.org/show_bug.cgi?id=40544 Before, we w

[clang-tools-extra] r361601 - [clang-tidy] Add option "LiteralInitializers" to cppcoreguidelines-pro-type-member-init

2019-05-23 Thread Matthias Gehre via cfe-commits
Author: mgehre Date: Thu May 23 22:46:57 2019 New Revision: 361601 URL: http://llvm.org/viewvc/llvm-project?rev=361601&view=rev Log: [clang-tidy] Add option "LiteralInitializers" to cppcoreguidelines-pro-type-member-init Differential Revision: D24892 Added: clang-tools-extra/trunk/test/cla

[clang-tools-extra] add51e1 - [clang-tidy] add new check readability-use-anyofallof

2020-06-03 Thread Matthias Gehre via cfe-commits
Author: Matthias Gehre Date: 2020-06-03T12:19:06+02:00 New Revision: add51e152aa6dc3aa7a51901a099b2ebe8cfe377 URL: https://github.com/llvm/llvm-project/commit/add51e152aa6dc3aa7a51901a099b2ebe8cfe377 DIFF: https://github.com/llvm/llvm-project/commit/add51e152aa6dc3aa7a51901a099b2ebe8cfe377.diff

[clang-tools-extra] eaa5559 - [clang-tidy] misc-unused-parameters: Don't remove parameter from lambda

2020-04-09 Thread Matthias Gehre via cfe-commits
Author: Matthias Gehre Date: 2020-04-09T19:26:41+02:00 New Revision: eaa55590945a130131a47a4d2b89e3bbdfced79e URL: https://github.com/llvm/llvm-project/commit/eaa55590945a130131a47a4d2b89e3bbdfced79e DIFF: https://github.com/llvm/llvm-project/commit/eaa55590945a130131a47a4d2b89e3bbdfced79e.diff

[clang] 0642e5e - [clang-tidy] modernize-use-using: Fix broken fixit with 'template' keyword

2020-04-17 Thread Matthias Gehre via cfe-commits
Author: Matthias Gehre Date: 2020-04-17T10:37:24+02:00 New Revision: 0642e5e7a7e54a11120262cfafea0193e3a75faf URL: https://github.com/llvm/llvm-project/commit/0642e5e7a7e54a11120262cfafea0193e3a75faf DIFF: https://github.com/llvm/llvm-project/commit/0642e5e7a7e54a11120262cfafea0193e3a75faf.diff

[clang] 145dcef - [clang-tidy] modernize-use-using: Fix broken fixit with InjectedClassName

2020-04-27 Thread Matthias Gehre via cfe-commits
Author: Matthias Gehre Date: 2020-04-27T14:23:23+02:00 New Revision: 145dcef8bdf9da9684c9c4e34a8e6c45baafab74 URL: https://github.com/llvm/llvm-project/commit/145dcef8bdf9da9684c9c4e34a8e6c45baafab74 DIFF: https://github.com/llvm/llvm-project/commit/145dcef8bdf9da9684c9c4e34a8e6c45baafab74.diff

[PATCH] D24845: [clang-tidy] fix for NOLINT after macro expansion

2016-09-22 Thread Matthias Gehre via cfe-commits
mgehre created this revision. mgehre added reviewers: alexfh, aaron.ballman, hokein. mgehre added a subscriber: cfe-commits. When having ``` c++ #define MACRO code-with-warning MACRO; // NOLINT ``` clang-tidy would still show the warning, because it searched for "NOLINT" only in the first

[PATCH] D24848: [clang-tidy] fix false-positive for cppcoreguidelines-pro-type-member-init with in-class initializers

2016-09-22 Thread Matthias Gehre via cfe-commits
mgehre created this revision. mgehre added reviewers: alexfh, aaron.ballman. mgehre added a subscriber: cfe-commits. Herald added a subscriber: nemanjai. This fixes https://llvm.org/bugs/show_bug.cgi?id=30487 where ``` warning: uninitialized record type: 's' [cppcoreguidelines-pro-type-member-init

[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

[PATCH] D24888: [clang-tidy] Use [[clang::suppress]] with cppcoreguidelines-pro-type-reinterpret-cast

2016-09-23 Thread Matthias Gehre via cfe-commits
mgehre created this revision. mgehre added reviewers: alexfh, aaron.ballman. mgehre added a subscriber: cfe-commits. Herald added a subscriber: nemanjai. This is a proof-of-concept how the [[clang::suppress(tags,...)]] attribute can work with suppressing clang-tidy warnings. The list of tags that

Re: [PATCH] D24888: [clang-tidy] Use [[clang::suppress]] with cppcoreguidelines-pro-type-reinterpret-cast

2016-09-23 Thread Matthias Gehre via cfe-commits
mgehre updated this revision to Diff 72365. mgehre added a comment. Minor fix https://reviews.llvm.org/D24888 Files: clang-tidy/cppcoreguidelines/ProTypeReinterpretCastCheck.cpp clang-tidy/cppcoreguidelines/Suppression.h docs/clang-tidy/checks/cppcoreguidelines-pro-type-reinterpret-cast.r

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 =

[clang-tools-extra] r282330 - [clang-tidy] fix for NOLINT after macro expansion

2016-09-24 Thread Matthias Gehre via cfe-commits
Author: mgehre Date: Sat Sep 24 11:06:53 2016 New Revision: 282330 URL: http://llvm.org/viewvc/llvm-project?rev=282330&view=rev Log: [clang-tidy] fix for NOLINT after macro expansion Summary: When having ``` c++ #define MACRO code-with-warning MACRO; // NOLINT ``` clang-tidy would still s

Re: [PATCH] D24845: [clang-tidy] fix for NOLINT after macro expansion

2016-09-24 Thread Matthias Gehre via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL282330: [clang-tidy] fix for NOLINT after macro expansion (authored by mgehre). Changed prior to commit: https://reviews.llvm.org/D24845?vs=72214&id=72391#toc Repository: rL LLVM https://reviews.llv

Re: [PATCH] D22587: [ASTContext] Fix part of DR224 for nontype template arguments

2016-09-24 Thread Matthias Gehre via cfe-commits
mgehre added a comment. I'm sorry if this sounds dumb, but is there a way for me to follow that particular discussion? https://reviews.llvm.org/D22587 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/lis

[PATCH] D24892: [clang-tidy] Add option "LiteralInitializers" to cppcoreguidelines-pro-type-member-init

2016-09-24 Thread Matthias Gehre via cfe-commits
mgehre created this revision. mgehre added reviewers: alexfh, aaron.ballman, hokein. mgehre added a subscriber: cfe-commits. Herald added a subscriber: nemanjai. Adds the option "LiteralInitializers" to cppcoreguidelines-pro-type-member-init. If set to non-zero, the check will provide fix-its with

Re: [PATCH] D24892: [clang-tidy] Add option "LiteralInitializers" to cppcoreguidelines-pro-type-member-init

2016-09-24 Thread Matthias Gehre via cfe-commits
mgehre updated this revision to Diff 72394. mgehre added a comment. Extend test to negative case https://reviews.llvm.org/D24892 Files: clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.h docs/clang-tidy/checks/cppcoreguidelines-pr

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] D24848: [clang-tidy] fix false-positive for cppcoreguidelines-pro-type-member-init with in-class initializers

2016-09-27 Thread Matthias Gehre via cfe-commits
mgehre updated this revision to Diff 72677. mgehre added a comment. Rename the struct that was introduced in the test. Note that I need to keep the function Bug30487, because that is where the false-positive warning was emitted. https://reviews.llvm.org/D24848 Files: clang-tidy/utils/TypeTra

Re: [PATCH] D24848: [clang-tidy] fix false-positive for cppcoreguidelines-pro-type-member-init with in-class initializers

2016-09-28 Thread Matthias Gehre via cfe-commits
mgehre added a comment. I would like to close that particular bug report, and thus I would like to have the reproducer of that bug as part of the test case. The PositivePartiallyInClassInitialized is also a good test, but I fail to see how it is proves that that particular bug is solved. Are yo

Re: [PATCH] D24888: [clang-tidy] Use [[clang::suppress]] with cppcoreguidelines-pro-type-reinterpret-cast

2016-09-28 Thread Matthias Gehre via cfe-commits
mgehre added inline comments. Comment at: clang-tidy/cppcoreguidelines/ProTypeReinterpretCastCheck.cpp:25 @@ -23,2 +24,3 @@ - Finder->addMatcher(cxxReinterpretCastExpr().bind("cast"), this); + std::vector Rules{"type", "type.1", "cppcoreguidelines-pro-type-reinterpret-cast"};

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 _

[clang-tools-extra] r282625 - [clang-tidy] fix false-positive for cppcoreguidelines-pro-type-member-init with in-class initializers

2016-09-28 Thread Matthias Gehre via cfe-commits
Author: mgehre Date: Wed Sep 28 15:06:18 2016 New Revision: 282625 URL: http://llvm.org/viewvc/llvm-project?rev=282625&view=rev Log: [clang-tidy] fix false-positive for cppcoreguidelines-pro-type-member-init with in-class initializers Summary: This fixes https://llvm.org/bugs/show_bug.cgi?id=304

Re: [PATCH] D24848: [clang-tidy] fix false-positive for cppcoreguidelines-pro-type-member-init with in-class initializers

2016-09-28 Thread Matthias Gehre via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL282625: [clang-tidy] fix false-positive for cppcoreguidelines-pro-type-member-init… (authored by mgehre). Changed prior to commit: https://reviews.llvm.org/D24848?vs=72677&id=72885#toc Repository: rL

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

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

2016-09-29 Thread Matthias Gehre via cfe-commits
mgehre updated this revision to Diff 72981.mgehre added a comment. View RevisionAdd additional gsl::suppress spelling, add test, add documentationhttps://reviews.llvm.org/D24886Files:include/clang/Basic/Attr.td include/clang/Basic/AttrDocs.td lib/Sema/SemaDeclAttr.cpp lib/Sema/SemaStmtAttr.cpp test

r369591 - [LifetimeAnalysis] Support more STL idioms (template forward declaration and DependentNameType)

2019-08-21 Thread Matthias Gehre via cfe-commits
Author: mgehre Date: Wed Aug 21 15:08:59 2019 New Revision: 369591 URL: http://llvm.org/viewvc/llvm-project?rev=369591&view=rev Log: [LifetimeAnalysis] Support more STL idioms (template forward declaration and DependentNameType) Summary: This fixes inference of gsl::Pointer on std::set::iterator

Re: r369591 - [LifetimeAnalysis] Support more STL idioms (template forward declaration and DependentNameType)

2019-08-22 Thread Matthias Gehre via cfe-commits
t; >> If we can make the gsl::Pointer diagnostics false-positive-free, that's >> great, but otherwise we should use a different warning flag for the >> warnings that involve these annotations and use -Wreturn-stack-address for >> only the zero-false-positive cases

r371182 - Reland [LifetimeAnalysis] Support more STL idioms (template forward declaration and DependentNameType)

2019-09-06 Thread Matthias Gehre via cfe-commits
Author: mgehre Date: Fri Sep 6 01:56:30 2019 New Revision: 371182 URL: http://llvm.org/viewvc/llvm-project?rev=371182&view=rev Log: Reland [LifetimeAnalysis] Support more STL idioms (template forward declaration and DependentNameType) Reland after https://reviews.llvm.org/D66806 fixed the false

r371241 - [LifetimeAnalysis] don't use raw string literals in macros

2019-09-06 Thread Matthias Gehre via cfe-commits
Author: mgehre Date: Fri Sep 6 12:15:02 2019 New Revision: 371241 URL: http://llvm.org/viewvc/llvm-project?rev=371241&view=rev Log: [LifetimeAnalysis] don't use raw string literals in macros They broke the AArch64 bots (gcc does not support it) Modified: cfe/trunk/unittests/Sema/GslOwnerPoi

Re: r371182 - Reland [LifetimeAnalysis] Support more STL idioms (template forward declaration and DependentNameType)

2019-09-06 Thread Matthias Gehre via cfe-commits
s/stdio > > Thanks, > Yvan > > On Fri, 6 Sep 2019 at 10:54, Matthias Gehre via cfe-commits > wrote: > > > > Author: mgehre > > Date: Fri Sep 6 01:56:30 2019 > > New Revision: 371182 > > > > URL: http://llvm.org/viewvc/llvm-project?rev=371182&view=

[clang] 7e17e15 - clang: Introduce -fexperimental-max-bitint-width

2022-06-08 Thread Matthias Gehre via cfe-commits
Author: Matthias Gehre Date: 2022-06-09T07:15:03+01:00 New Revision: 7e17e15c9f01a04283524c6a6735d639aac39fe6 URL: https://github.com/llvm/llvm-project/commit/7e17e15c9f01a04283524c6a6735d639aac39fe6 DIFF: https://github.com/llvm/llvm-project/commit/7e17e15c9f01a04283524c6a6735d639aac39fe6.diff

[clang-tools-extra] 24130d6 - [clang-tidy] Add readability-make-member-function-const

2019-11-06 Thread Matthias Gehre via cfe-commits
Author: Matthias Gehre Date: 2019-11-06T09:27:02+01:00 New Revision: 24130d661ed42c30f009b695d3c9ce57d2208b5e URL: https://github.com/llvm/llvm-project/commit/24130d661ed42c30f009b695d3c9ce57d2208b5e DIFF: https://github.com/llvm/llvm-project/commit/24130d661ed42c30f009b695d3c9ce57d2208b5e.diff

r298126 - Implement DR 373 "Lookup on namespace qualified name in using-directive"

2017-03-17 Thread Matthias Gehre via cfe-commits
Author: mgehre Date: Fri Mar 17 16:41:20 2017 New Revision: 298126 URL: http://llvm.org/viewvc/llvm-project?rev=298126&view=rev Log: Implement DR 373 "Lookup on namespace qualified name in using-directive" Summary: 3.4.6 [basic.lookup.udir] paragraph 1: In a using-directive or namespace-alias-def

r298880 - Add [[clang::suppress(rule, ...)]] attribute

2017-03-27 Thread Matthias Gehre via cfe-commits
Author: mgehre Date: Mon Mar 27 14:45:24 2017 New Revision: 298880 URL: http://llvm.org/viewvc/llvm-project?rev=298880&view=rev Log: Add [[clang::suppress(rule, ...)]] attribute Summary: This patch implements parsing of [[clang::suppress(rule, ...)]] and [[gsl::suppress(rule, ...)]] attributes.

r299465 - [clang-format] fix crash in NamespaceEndCommentsFixer (PR32438)

2017-04-04 Thread Matthias Gehre via cfe-commits
Author: mgehre Date: Tue Apr 4 15:11:13 2017 New Revision: 299465 URL: http://llvm.org/viewvc/llvm-project?rev=299465&view=rev Log: [clang-format] fix crash in NamespaceEndCommentsFixer (PR32438) Summary: The new test case was crashing before. Now it passes as expected. Reviewers: djasper Subs

r307759 - CFG: Add CFGElement for automatic variables that leave the scope

2017-07-12 Thread Matthias Gehre via cfe-commits
Author: mgehre Date: Wed Jul 12 00:04:19 2017 New Revision: 307759 URL: http://llvm.org/viewvc/llvm-project?rev=307759&view=rev Log: CFG: Add CFGElement for automatic variables that leave the scope Summary: This mimics the implementation for the implicit destructors. The generation of this scope

[PATCH] D24888: [clang-tidy] Use [[clang::suppress]] with cppcoreguidelines-pro-type-reinterpret-cast

2016-10-20 Thread Matthias Gehre via cfe-commits
mgehre added inline comments. Comment at: clang-tidy/cppcoreguidelines/ProTypeReinterpretCastCheck.cpp:25 - Finder->addMatcher(cxxReinterpretCastExpr().bind("cast"), this); + std::vector Rules{"type", "type.1", "cppcoreguidelines-pro-type-reinterpret-cast"}; + Finder->addM

[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] D26125: [clang-tidy] Fixed else-after-return warning in cascade if statement

2016-10-30 Thread Matthias Gehre via cfe-commits
mgehre added a comment. With this fix, is there still a warning on the following code? if(b) { ... if(c) return; else doSomething() ... } I would expect that the check still warns on it. https://reviews.llvm.org/D26125

[PATCH] D13313: [clang-tidy] new check misc-no-reinterpret-cast

2015-09-30 Thread Matthias Gehre via cfe-commits
mgehre created this revision. mgehre added a subscriber: cfe-commits. This check flags all uses of reinterpret_cast in C++ code. Use of these casts can violate type safety and cause the program to access a variable that is actually of type X to be accessed as if it were of an unrelated type Z. T

Re: [PATCH] D13313: [clang-tidy] new check misc-no-reinterpret-cast

2015-10-01 Thread Matthias Gehre via cfe-commits
mgehre updated this revision to Diff 36291. mgehre added a comment. Renamed the check to cppcoreguidelines-pro-type-reinterpret-cast http://reviews.llvm.org/D13313 Files: clang-tidy/CMakeLists.txt clang-tidy/Makefile clang-tidy/cppcoreguidelines/CMakeLists.txt clang-tidy/cppcoreguidelin

Re: [PATCH] D13313: [clang-tidy] new check misc-no-reinterpret-cast

2015-10-01 Thread Matthias Gehre via cfe-commits
mgehre updated this revision to Diff 36294. mgehre added a comment. Fix add_new_check.py for capitalization of CppCoreGuidelinesTidyModule.cpp http://reviews.llvm.org/D13313 Files: clang-tidy/CMakeLists.txt clang-tidy/Makefile clang-tidy/add_new_check.py clang-tidy/cppcoreguidelines/CMa

Re: [PATCH] D13313: [clang-tidy] new check misc-no-reinterpret-cast

2015-10-01 Thread Matthias Gehre via cfe-commits
mgehre updated this revision to Diff 36296. mgehre added a comment. Read 'Check' suffix on ProTypeReinterpretCastCheck http://reviews.llvm.org/D13313 Files: clang-tidy/CMakeLists.txt clang-tidy/Makefile clang-tidy/add_new_check.py clang-tidy/cppcoreguidelines/CMakeLists.txt clang-tidy

Re: [PATCH] D13311: [clang-tidy] Add check misc-pointer-arithmetic

2015-10-01 Thread Matthias Gehre via cfe-commits
mgehre updated this revision to Diff 36300. mgehre added a comment. Port to cppcoreguidelines module. Add checks for post/pre increment/decrement and array access. http://reviews.llvm.org/D13311 Files: clang-tidy/CMakeLists.txt clang-tidy/Makefile clang-tidy/add_new_check.py clang-tidy/

Re: [PATCH] D13311: [clang-tidy] Add check misc-pointer-arithmetic

2015-10-01 Thread Matthias Gehre via cfe-commits
mgehre updated this revision to Diff 36305. mgehre added a comment. Remove inclusion of misc-no-reinterpret-cast in this patch set http://reviews.llvm.org/D13311 Files: clang-tidy/cppcoreguidelines/CMakeLists.txt clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp clang-tidy/cppc

[PATCH] D13368: [clang-tidy] add check cppcoreguidelines-pro-type-static-cast-downcast

2015-10-01 Thread Matthias Gehre via cfe-commits
mgehre created this revision. mgehre added reviewers: alexfh, sbenza, bkramer, aaron.ballman. mgehre added a subscriber: cfe-commits. mgehre added a dependency: D13313: [clang-tidy] new check cppcoreguidelines-pro-type-reinterpret-cast. This check flags all usages of static_cast, where a base cla

Re: [PATCH] D13313: [clang-tidy] new check cppcoreguidelines-pro-type-reinterpret-cast

2015-10-02 Thread Matthias Gehre via cfe-commits
mgehre updated this revision to Diff 36371. mgehre added a comment. Rebased Removed "(C++ Core Guidelines, rule Type.1)" from diagnostic Can someone please commit this? http://reviews.llvm.org/D13313 Files: clang-tidy/CMakeLists.txt clang-tidy/Makefile clang-tidy/add_new_check.py clang

Re: [PATCH] D13313: [clang-tidy] new check cppcoreguidelines-pro-type-reinterpret-cast

2015-10-02 Thread Matthias Gehre via cfe-commits
mgehre updated this revision to Diff 36372. mgehre added a comment. Shot to fast, fixed test. Now it's ready http://reviews.llvm.org/D13313 Files: clang-tidy/CMakeLists.txt clang-tidy/Makefile clang-tidy/add_new_check.py clang-tidy/cppcoreguidelines/CMakeLists.txt clang-tidy/cppcoreg

Re: [PATCH] D13313: [clang-tidy] new check cppcoreguidelines-pro-type-reinterpret-cast

2015-10-02 Thread Matthias Gehre via cfe-commits
mgehre updated this revision to Diff 36399. mgehre added a comment. rebased http://reviews.llvm.org/D13313 Files: clang-tidy/CMakeLists.txt clang-tidy/Makefile clang-tidy/add_new_check.py clang-tidy/cppcoreguidelines/CMakeLists.txt clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyMod

Re: [PATCH] D13313: [clang-tidy] new check cppcoreguidelines-pro-type-reinterpret-cast

2015-10-02 Thread Matthias Gehre via cfe-commits
mgehre added a comment. I'm not sure what you mean by ToT. I rebased this against master @ http://llvm.org/git/clang-tools-extra.git http://reviews.llvm.org/D13313 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bi

Re: [PATCH] D13311: [clang-tidy] Add check cppcoreguidelines-pro-bounds-pointer-arithmetic

2015-10-02 Thread Matthias Gehre via cfe-commits
mgehre updated this revision to Diff 36403. mgehre marked 7 inline comments as done. mgehre added a comment. Incorporated comments Simplied matcher: Instead of checking argument types, just check that the result of the arithmetic operation is a pointer http://reviews.llvm.org/D13311 Files: c

Re: [PATCH] D13311: [clang-tidy] Add check cppcoreguidelines-pro-bounds-pointer-arithmetic

2015-10-02 Thread Matthias Gehre via cfe-commits
mgehre added a comment. Thank you for the review comments! Comment at: clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.cpp:38 @@ +37,3 @@ + Finder->addMatcher( + arraySubscriptExpr(hasBase(implicitCastExpr(hasSourceExpression( + has

Re: [PATCH] D13311: [clang-tidy] Add check cppcoreguidelines-pro-bounds-pointer-arithmetic

2015-10-02 Thread Matthias Gehre via cfe-commits
mgehre updated this revision to Diff 36404. mgehre added a comment. Fix typo http://reviews.llvm.org/D13311 Files: clang-tidy/cppcoreguidelines/CMakeLists.txt clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.cpp cl

[PATCH] D13398: [clang-tidy] add check cppcoreguidelines-pro-type-const-cast

2015-10-02 Thread Matthias Gehre via cfe-commits
mgehre created this revision. mgehre added reviewers: alexfh, sbenza, bkramer, aaron.ballman. mgehre added a subscriber: cfe-commits. mgehre added a dependency: D13313: [clang-tidy] new check cppcoreguidelines-pro-type-reinterpret-cast. This check flags all uses of const_cast in C++ code. Modify

Re: [PATCH] D13368: [clang-tidy] add check cppcoreguidelines-pro-type-static-cast-downcast

2015-10-04 Thread Matthias Gehre via cfe-commits
mgehre updated this revision to Diff 36465. mgehre marked 3 inline comments as done. mgehre added a comment. Fixed comments. Only show fixit for polymorphic classes. Ignore template instantiations for now http://reviews.llvm.org/D13368 Files: clang-tidy/cppcoreguidelines/CMakeLists.txt cla

Re: [PATCH] D13368: [clang-tidy] add check cppcoreguidelines-pro-type-static-cast-downcast

2015-10-04 Thread Matthias Gehre via cfe-commits
mgehre marked 2 inline comments as done. mgehre added a comment. Thank you for the detailed review. I disabled checks in template instantiations for now. Ideally, I would want to see something like: warning: do not use static_cast to cast from base class to derived class. note: in instantiati

Re: [PATCH] D13313: [clang-tidy] new check cppcoreguidelines-pro-type-reinterpret-cast

2015-10-05 Thread Matthias Gehre via cfe-commits
mgehre updated this revision to Diff 36557. mgehre added a comment. Rebased http://reviews.llvm.org/D13313 Files: clang-tidy/CMakeLists.txt clang-tidy/Makefile clang-tidy/add_new_check.py clang-tidy/cppcoreguidelines/CMakeLists.txt clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyMod

Re: [PATCH] D13313: [clang-tidy] new check cppcoreguidelines-pro-type-reinterpret-cast

2015-10-05 Thread Matthias Gehre via cfe-commits
mgehre updated this revision to Diff 36561. mgehre added a comment. "arc diff" produced a invalid patch file (due to some file being "moved"?) This patch is manually generated by git format-patch. I checked that it applies cleanly against svn trunk. http://reviews.llvm.org/D13313 Files: clan

Re: [PATCH] D13311: [clang-tidy] Add check cppcoreguidelines-pro-bounds-pointer-arithmetic

2015-10-05 Thread Matthias Gehre via cfe-commits
mgehre updated this revision to Diff 36564. mgehre added a comment. Fixed space after // http://reviews.llvm.org/D13311 Files: clang-tidy/cppcoreguidelines/CMakeLists.txt clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCh

Re: [PATCH] D13368: [clang-tidy] add check cppcoreguidelines-pro-type-static-cast-downcast

2015-10-05 Thread Matthias Gehre via cfe-commits
mgehre marked an inline comment as done. Comment at: clang-tidy/cppcoreguidelines/ProTypeStaticCastDowncastCheck.cpp:53 @@ +52,3 @@ + } else { +diag(MatchedCast->getOperatorLoc(), "do not use static_cast to cast from base class to derived class."); + } aaro

Re: [PATCH] D13368: [clang-tidy] add check cppcoreguidelines-pro-type-static-cast-downcast

2015-10-05 Thread Matthias Gehre via cfe-commits
mgehre updated this revision to Diff 36567. mgehre marked 2 inline comments as done. mgehre added a comment. Simplify logic to check for BaseToDerived cast. Add test for object to reference cast. Fixed comments http://reviews.llvm.org/D13368 Files: clang-tidy/cppcoreguidelines/CMakeLists.txt

Re: [PATCH] D13368: [clang-tidy] add check cppcoreguidelines-pro-type-static-cast-downcast

2015-10-05 Thread Matthias Gehre via cfe-commits
mgehre added inline comments. Comment at: clang-tidy/cppcoreguidelines/ProTypeStaticCastDowncastCheck.cpp:33 @@ +32,3 @@ + const auto *SourceDecl = SourceType->getPointeeCXXRecordDecl(); + if(!SourceDecl) +SourceDecl = SourceType->getAsCXXRecordDecl(); aaron

Re: [PATCH] D13311: [clang-tidy] Add check cppcoreguidelines-pro-bounds-pointer-arithmetic

2015-10-06 Thread Matthias Gehre via cfe-commits
mgehre marked 2 inline comments as done. Comment at: test/clang-tidy/cppcoreguidelines-pro-bounds-pointer-arithmetic.cpp:37 @@ +36,3 @@ + q -= i; + // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: do not use pointer arithmetic + q -= ENUM_LITERAL; aaron.ballman wro

Re: [PATCH] D13368: [clang-tidy] add check cppcoreguidelines-pro-type-static-cast-downcast

2015-10-06 Thread Matthias Gehre via cfe-commits
mgehre updated this revision to Diff 36664. mgehre added a comment. Remove trailing [cppcoreguidelines-pro-type-static-cast-downcast] on tests http://reviews.llvm.org/D13368 Files: clang-tidy/cppcoreguidelines/CMakeLists.txt clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp cla

Re: [PATCH] D13368: [clang-tidy] add check cppcoreguidelines-pro-type-static-cast-downcast

2015-10-06 Thread Matthias Gehre via cfe-commits
mgehre marked an inline comment as done. mgehre added a comment. I cannot think of any way to improve the usefulness of the diagnostic in the non-polymorphic case. For now, this patch has a link to the CppCoreGuidelines document in the docs/**/*.rst file. Also, this check is not enabled by defa

Re: [PATCH] D13398: [clang-tidy] add check cppcoreguidelines-pro-type-const-cast

2015-10-06 Thread Matthias Gehre via cfe-commits
mgehre updated this revision to Diff 36668. mgehre added a comment. Rebased http://reviews.llvm.org/D13398 Files: clang-tidy/cppcoreguidelines/CMakeLists.txt clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp clang-tidy/cppcoreguidelines/ProTypeConstCastCheck.cpp clang-tidy/cp

Re: [PATCH] D13440: [clang-tidy] Python script for easy check rename

2015-10-07 Thread Matthias Gehre via cfe-commits
mgehre added a subscriber: mgehre. Comment at: clang-tidy/rename_check.py:39 @@ +38,3 @@ + if len(sys.argv) != 4: +print('Usage: rename_check.py , e.g.\n') +print('rename_check.py misc awesome-functions new-awesome-function\n') Should be ``` Usage: renam

Re: [PATCH] D13510: [PATCH] Support C++ Core Guidelines copy assignment restrictions

2015-10-07 Thread Matthias Gehre via cfe-commits
mgehre added a comment. The user will see [cppcoreguidelines-c-copy-assignment-signature] in warnings, but there is no docs/clang-tidy/checks/cppcoreguidelines-c-copy-assignment-signature.rst. The user won't know that he needs to look for misc-assign-operator-signature. Maybe create a link to

[PATCH] D13639: Add decayedType and hasDecayedType AST matchers

2015-10-11 Thread Matthias Gehre via cfe-commits
mgehre created this revision. mgehre added a reviewer: klimek. mgehre added a subscriber: cfe-commits. Herald added a subscriber: klimek. Add decayedType and hasDecayedType AST matchers http://reviews.llvm.org/D13639 Files: include/clang/ASTMatchers/ASTMatchers.h lib/ASTMatchers/Dynamic/Regi

Re: [PATCH] D13639: Add decayedType and hasDecayedType AST matchers

2015-10-11 Thread Matthias Gehre via cfe-commits
mgehre updated this revision to Diff 37066. mgehre added a comment. Add test http://reviews.llvm.org/D13639 Files: include/clang/ASTMatchers/ASTMatchers.h lib/ASTMatchers/Dynamic/Registry.cpp unittests/ASTMatchers/ASTMatchersTest.cpp Index: unittests/ASTMatchers/ASTMatchersTest.cpp =

[clang-tools-extra] r250002 - Test commit

2015-10-11 Thread Matthias Gehre via cfe-commits
Author: mgehre Date: Sun Oct 11 17:55:29 2015 New Revision: 250002 URL: http://llvm.org/viewvc/llvm-project?rev=250002&view=rev Log: Test commit Modified: clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp Modified: clang-tools-extra/trunk/clang-tidy/cppco

[PATCH] D13640: [clang-tidy] Add new check cppcoreguidelines-pro-bounds-array-to-pointer-decay

2015-10-11 Thread Matthias Gehre via cfe-commits
mgehre created this revision. mgehre added reviewers: alexfh, sbenza, bkramer, aaron.ballman. mgehre added a subscriber: cfe-commits. This check flags all array to pointer decays. Pointers should not be used as arrays. array_view is a bounds-checked, safe alternative to using pointers to access a

Re: [PATCH] D13368: [clang-tidy] add check cppcoreguidelines-pro-type-static-cast-downcast

2015-10-12 Thread Matthias Gehre via cfe-commits
mgehre updated this revision to Diff 37155. mgehre marked an inline comment as done. mgehre added a comment. Add test for static_cast with const http://reviews.llvm.org/D13368 Files: clang-tidy/cppcoreguidelines/CMakeLists.txt clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp c

[clang-tools-extra] r250098 - [clang-tidy] add check cppcoreguidelines-pro-type-static-cast-downcast

2015-10-12 Thread Matthias Gehre via cfe-commits
Author: mgehre Date: Mon Oct 12 15:46:53 2015 New Revision: 250098 URL: http://llvm.org/viewvc/llvm-project?rev=250098&view=rev Log: [clang-tidy] add check cppcoreguidelines-pro-type-static-cast-downcast Summary: This check flags all usages of static_cast, where a base class is casted to a derive

Re: [PATCH] D13368: [clang-tidy] add check cppcoreguidelines-pro-type-static-cast-downcast

2015-10-12 Thread Matthias Gehre via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL250098: [clang-tidy] add check cppcoreguidelines-pro-type-static-cast-downcast (authored by mgehre). Changed prior to commit: http://reviews.llvm.org/D13368?vs=37155&id=37164#toc Repository: rL LLVM

r250114 - Add decayedType and hasDecayedType AST matchers

2015-10-12 Thread Matthias Gehre via cfe-commits
Author: mgehre Date: Mon Oct 12 16:46:07 2015 New Revision: 250114 URL: http://llvm.org/viewvc/llvm-project?rev=250114&view=rev Log: Add decayedType and hasDecayedType AST matchers Summary: Add decayedType and hasDecayedType AST matchers Reviewers: klimek Subscribers: klimek, cfe-commits Diffe

Re: [PATCH] D13639: Add decayedType and hasDecayedType AST matchers

2015-10-12 Thread Matthias Gehre via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL250114: Add decayedType and hasDecayedType AST matchers (authored by mgehre). Changed prior to commit: http://reviews.llvm.org/D13639?vs=37066&id=37178#toc Repository: rL LLVM http://reviews.llvm.or

[clang-tools-extra] r250116 - [clang-tidy] new check cppcoreguidelines-pro-bounds-pointer-arithmetic

2015-10-12 Thread Matthias Gehre via cfe-commits
Author: mgehre Date: Mon Oct 12 16:53:19 2015 New Revision: 250116 URL: http://llvm.org/viewvc/llvm-project?rev=250116&view=rev Log: [clang-tidy] new check cppcoreguidelines-pro-bounds-pointer-arithmetic Summary: This check flags all usage of pointer arithmetic, because it could lead to an invali

Re: [PATCH] D13311: [clang-tidy] Add check cppcoreguidelines-pro-bounds-pointer-arithmetic

2015-10-12 Thread Matthias Gehre via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL250116: [clang-tidy] new check cppcoreguidelines-pro-bounds-pointer-arithmetic (authored by mgehre). Changed prior to commit: http://reviews.llvm.org/D13311?vs=36564&id=37183#toc Repository: rL LLVM

Re: [PATCH] D13640: [clang-tidy] Add new check cppcoreguidelines-pro-bounds-array-to-pointer-decay

2015-10-12 Thread Matthias Gehre via cfe-commits
mgehre added inline comments. Comment at: clang-tidy/cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.cpp:29 @@ +28,3 @@ + implicitCastExpr(unless(hasParent(arraySubscriptExpr())), + unless(hasSourceExpression(declRefExpr(to(varDecl(hasName("__range

[PATCH] D13746: [clang-tidy] add check cppcoreguidelines-pro-bounds-constant-array-index

2015-10-14 Thread Matthias Gehre via cfe-commits
mgehre created this revision. mgehre added reviewers: alexfh, sbenza, bkramer, aaron.ballman. mgehre added a subscriber: cfe-commits. This check flags all array subscriptions on static arrays and std::arrays that either have a non-compile-time-constant index or are out of bounds. Dynamic accesses

Re: [PATCH] D13640: [clang-tidy] Add new check cppcoreguidelines-pro-bounds-array-to-pointer-decay

2015-10-14 Thread Matthias Gehre via cfe-commits
mgehre updated this revision to Diff 37396. mgehre marked an inline comment as done. mgehre added a comment. Test more complex array arithmetic, test gsl::array_view works, add "use array_view instead" to diagnostic http://reviews.llvm.org/D13640 Files: clang-tidy/cppcoreguidelines/CMakeList

Re: [PATCH] D13746: [clang-tidy] add check cppcoreguidelines-pro-bounds-constant-array-index

2015-10-14 Thread Matthias Gehre via cfe-commits
mgehre updated this revision to Diff 37401. mgehre added a comment. Remove dead codet http://reviews.llvm.org/D13746 Files: clang-tidy/cppcoreguidelines/CMakeLists.txt clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexChec

Re: [PATCH] D13640: [clang-tidy] Add new check cppcoreguidelines-pro-bounds-array-to-pointer-decay

2015-10-14 Thread Matthias Gehre via cfe-commits
mgehre updated this revision to Diff 37417. mgehre marked 7 inline comments as done. mgehre added a comment. Matcher does not rely on __range anymore http://reviews.llvm.org/D13640 Files: clang-tidy/cppcoreguidelines/CMakeLists.txt clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cp

Re: [PATCH] D13640: [clang-tidy] Add new check cppcoreguidelines-pro-bounds-array-to-pointer-decay

2015-10-14 Thread Matthias Gehre via cfe-commits
mgehre added a comment. Updated commit to fix comments http://reviews.llvm.org/D13640 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D13784: [clang-tidy] add check cppcoreguidelines-pro-type-union-access

2015-10-15 Thread Matthias Gehre via cfe-commits
mgehre created this revision. mgehre added reviewers: alexfh, sbenza, bkramer, aaron.ballman. mgehre added a subscriber: cfe-commits. This check flags all access to members of unions. Passing unions as a whole is not flagged. Reading from a union member assumes that member was the last one writte

[PATCH] D13785: [clang-tidy] add cert's VariadicFunctionDefCheck as cppcoreguidelines-pro-type-vararg-def

2015-10-15 Thread Matthias Gehre via cfe-commits
mgehre created this revision. mgehre added reviewers: alexfh, sbenza, bkramer, aaron.ballman. mgehre added a subscriber: cfe-commits. Import the cert check for variadic function definitions into cppcoreguidelines module to check part of https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCo

[PATCH] D13787: [clang-tidy] add check cppcoreguidelines-pro-type-vararg-use

2015-10-15 Thread Matthias Gehre via cfe-commits
mgehre created this revision. mgehre added reviewers: alexfh, sbenza, bkramer, aaron.ballman. mgehre added a subscriber: cfe-commits. This check flags all calls to c-style vararg functions. Passing to varargs assumes the correct type will be read. This is fragile because it cannot generally be en

Re: [PATCH] D13785: [clang-tidy] add cert's VariadicFunctionDefCheck as cppcoreguidelines-pro-type-vararg-def

2015-10-15 Thread Matthias Gehre via cfe-commits
mgehre added a comment. I have commit privileges :-) http://reviews.llvm.org/D13785 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] r250468 - [clang-tidy] add cert's VariadicFunctionDefCheck as cppcoreguidelines-pro-type-vararg-def

2015-10-15 Thread Matthias Gehre via cfe-commits
Author: mgehre Date: Thu Oct 15 17:40:45 2015 New Revision: 250468 URL: http://llvm.org/viewvc/llvm-project?rev=250468&view=rev Log: [clang-tidy] add cert's VariadicFunctionDefCheck as cppcoreguidelines-pro-type-vararg-def Summary: Import the cert check for variadic function definitions into cpp

Re: [PATCH] D13785: [clang-tidy] add cert's VariadicFunctionDefCheck as cppcoreguidelines-pro-type-vararg-def

2015-10-15 Thread Matthias Gehre via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL250468: [clang-tidy] add cert's VariadicFunctionDefCheck as cppcoreguidelines-pro… (authored by mgehre). Changed prior to commit: http://reviews.llvm.org/D13785?vs=37516&id=37532#toc Repository: rL L

[clang-tools-extra] r250537 - [clang-tidy] add check cppcoreguidelines-pro-type-union-access

2015-10-16 Thread Matthias Gehre via cfe-commits
Author: mgehre Date: Fri Oct 16 13:46:30 2015 New Revision: 250537 URL: http://llvm.org/viewvc/llvm-project?rev=250537&view=rev Log: [clang-tidy] add check cppcoreguidelines-pro-type-union-access Summary: This check flags all access to members of unions. Passing unions as a whole is not flagged.

Re: [PATCH] D13784: [clang-tidy] add check cppcoreguidelines-pro-type-union-access

2015-10-16 Thread Matthias Gehre via cfe-commits
mgehre marked an inline comment as done. mgehre added a comment. http://reviews.llvm.org/D13784 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

  1   2   3   >