Re: [PATCH] D23130: [Clang-tidy] Add a check for definitions in the global namespace.

2016-08-03 Thread Piotr Padlewski via cfe-commits
Prazek added inline comments. Comment at: clang-tidy/misc/GlobalNamespaceCheck.cpp:46 @@ +45,3 @@ +// extern "C" globals need to be in the global namespace. +if (VDecl->isExternC()) + return; I think it would be better to check it in matcher. I see th

Re: [PATCH] D23243: [clang-tidy] enhance modernize-use-bool-literals to check ternary operator

2016-08-06 Thread Piotr Padlewski via cfe-commits
Prazek added inline comments. Comment at: clang-tidy/modernize/UseBoolLiteralsCheck.cpp:38-43 @@ +37,8 @@ + unless(isInTemplateInstantiation(, + anyOf(hasTrueExpression(ignoringParenImpCasts( +integerLiteral().bind("trueBranchLiteral")

Re: [PATCH] D23243: [clang-tidy] enhance modernize-use-bool-literals to check ternary operator

2016-08-07 Thread Piotr Padlewski via cfe-commits
Prazek accepted this revision. Prazek added a reviewer: Prazek. Prazek added a comment. This revision is now accepted and ready to land. LGTM, but wait a day, maybe someone will have other comments. https://reviews.llvm.org/D23243 ___ cfe-commits ma

Re: [PATCH] D23243: [clang-tidy] enhance modernize-use-bool-literals to check ternary operator

2016-08-07 Thread Piotr Padlewski via cfe-commits
Prazek added a comment. Yea, I also have never heard of it. I don't think it is worth even discussing https://reviews.llvm.org/D23243 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D23243: [clang-tidy] enhance modernize-use-bool-literals to check ternary operator

2016-08-07 Thread Piotr Padlewski via cfe-commits
2016-08-07 15:38 GMT-07:00 Aaron Ballman : On Sun, Aug 7, 2016 at 6:33 PM, Piotr Padlewski > wrote: > > Prazek added a comment. > > > > Yea, I also have never heard of it. I don't think it is worth even > discussing > Just because you've never heard of a compiler extension that gets > pointed out

Re: r277923 - [ASTReader] Use real move semantics instead of emulating them in the copy ctor.

2016-08-07 Thread Piotr Padlewski via cfe-commits
2016-08-06 5:45 GMT-07:00 Benjamin Kramer via cfe-commits < cfe-commits@lists.llvm.org>: > Author: d0k > Date: Sat Aug 6 07:45:16 2016 > New Revision: 277923 > > URL: http://llvm.org/viewvc/llvm-project?rev=277923&view=rev > Log: > [ASTReader] Use real move semantics instead of emulating them in

Re: [PATCH] D22725: [clang-tidy] Add check 'modernize-use-algorithm'

2016-08-08 Thread Piotr Padlewski via cfe-commits
2016-08-08 8:33 GMT-07:00 Aaron Ballman : > aaron.ballman added inline comments. > > > Comment at: clang-tidy/modernize/UseAlgorithmCheck.cpp:59-61 > @@ +58,5 @@ > + IncludeStyle(utils::IncludeSorter::parseIncludeStyle( > + Options.get("IncludeStyle", "llvm"))) { > +

Re: [PATCH] D23257: Fix clang-tidy crash when a single fix is applied on multiple files.

2016-08-08 Thread Piotr Padlewski via cfe-commits
Prazek added a subscriber: Prazek. Prazek added a comment. I remember that it was pissing me off when I used clang-tidy first time. Thanks for fixing that! https://reviews.llvm.org/D23257 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http

Re: [PATCH] D22725: [clang-tidy] Add check 'modernize-use-algorithm'

2016-08-09 Thread Piotr Padlewski via cfe-commits
2016-08-09 5:49 GMT-07:00 Aaron Ballman : > > I think this boils down to personal preference, which is why I'm > concerned about the check. Either mechanism is correct, so this is > purely a stylistic check in many regards. > > About warnings - well, if someone choose this check to be run, then he

[PATCH] D23343: [clang-tidy] modernize-make-{smart_ptr} private ctor bugfix

2016-08-09 Thread Piotr Padlewski via cfe-commits
Prazek created this revision. Prazek added reviewers: alexfh, aaron.ballman, hokein. Prazek added a subscriber: cfe-commits. Bugfix for 27321. When the constructor of stored pointer type is private then it is invalid to change it to make_shared or make_unique. https://reviews.llvm.org/D23343 Fil

Re: [PATCH] D23343: [clang-tidy] modernize-make-{smart_ptr} private ctor bugfix

2016-08-09 Thread Piotr Padlewski via cfe-commits
Prazek updated this revision to Diff 67460. Prazek added a comment. I hate it when arc do this thing. When origin/master is not the trunk... https://reviews.llvm.org/D23343 Files: clang-tidy/modernize/MakeSmartPtrCheck.cpp docs/ReleaseNotes.rst test/clang-tidy/modernize-make-shared.cpp

Re: [PATCH] D23353: [clang-tidy] Add check 'misc-use-after-move'

2016-08-10 Thread Piotr Padlewski via cfe-commits
Prazek added a subscriber: Prazek. Prazek added a reviewer: Prazek. Prazek added a comment. I will review it later, but my first thoughts: 1. I think we should make some other group, because misc seems to be overloaded. I discussed it with Alex months ago - something like bugprone would be good

Re: [PATCH] D23343: [clang-tidy] modernize-make-{smart_ptr} private ctor bugfix

2016-08-10 Thread Piotr Padlewski via cfe-commits
Prazek added inline comments. Comment at: test/clang-tidy/modernize-make-shared.cpp:109 @@ +108,3 @@ + void create() { +auto ptr = std::shared_ptr(new Private(42)); + } aaron.ballman wrote: > Add comments explaining why make_shared is not correct. Also, plea

Re: [PATCH] D15332: new clang-tidy checker readability-non-const-parameter

2016-08-12 Thread Piotr Padlewski via cfe-commits
Prazek added a subscriber: Prazek. Comment at: clang-tidy/readability/NonConstParameterCheck.cpp:95-98 @@ +94,6 @@ +const QualType T = VD->getType(); +if (T->isPointerType() && !T->getPointeeType().isConstQualified()) + markCanNotBeConst(VD->getInit(), true); +els

Re: [PATCH] D23343: [clang-tidy] modernize-make-{smart_ptr} private ctor bugfix

2016-08-13 Thread Piotr Padlewski via cfe-commits
Prazek updated this revision to Diff 67966. Prazek marked 6 inline comments as done. Prazek added a comment. - fixes https://reviews.llvm.org/D23343 Files: clang-tidy/modernize/MakeSmartPtrCheck.cpp docs/ReleaseNotes.rst test/clang-tidy/modernize-make-shared.cpp test/clang-tidy/moderniz

Re: [PATCH] D23343: [clang-tidy] modernize-make-{smart_ptr} private ctor bugfix

2016-08-13 Thread Piotr Padlewski via cfe-commits
Prazek updated this revision to Diff 67967. Prazek added a comment. - fixes https://reviews.llvm.org/D23343 Files: clang-tidy/modernize/MakeSmartPtrCheck.cpp docs/ReleaseNotes.rst test/clang-tidy/modernize-make-shared.cpp test/clang-tidy/modernize-make-unique.cpp Index: test/clang-tidy

Re: [PATCH] D22346: [Clang-tidy] CERT-MSC50-CPP (std:rand() )

2016-08-14 Thread Piotr Padlewski via cfe-commits
Prazek accepted this revision. Prazek added a comment. This revision is now accepted and ready to land. LGTM with the fixes of docs. Comment at: clang-tidy/cert/LimitedRandomnessCheck.cpp:31 @@ +30,3 @@ + Result.Nodes.getNodeAs("randomGenerator"); + diag(MatchedDecl->getLo

Re: [PATCH] D22346: [Clang-tidy] CERT-MSC50-CPP (std:rand() )

2016-08-14 Thread Piotr Padlewski via cfe-commits
Prazek added inline comments. Comment at: clang-tidy/cert/LimitedRandomnessCheck.cpp:22-23 @@ +21,4 @@ + Finder->addMatcher( + declRefExpr(hasDeclaration(functionDecl(namedDecl(hasName("::rand")), + parameterCountIs(0 +

Re: [PATCH] D22346: [Clang-tidy] CERT-MSC50-CPP (std:rand() )

2016-08-14 Thread Piotr Padlewski via cfe-commits
Prazek added inline comments. Comment at: clang-tidy/cert/LimitedRandomnessCheck.cpp:22-23 @@ +21,4 @@ + Finder->addMatcher( + declRefExpr(hasDeclaration(functionDecl(namedDecl(hasName("::rand")), + parameterCountIs(0 +

Re: [PATCH] D15506: [ASTMatchers] Allow hasName() to look through inline namespaces

2016-02-04 Thread Piotr Padlewski via cfe-commits
Prazek added a subscriber: Prazek. Prazek added a comment. What is the status of it? http://reviews.llvm.org/D15506 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D18136: boost-use-to-string check

2016-04-26 Thread Piotr Padlewski via cfe-commits
Prazek marked 5 inline comments as done. Comment at: clang-tidy/boost/UseToStringCheck.cpp:60 @@ +59,3 @@ + else +return; + alexfh wrote: > Please add a reduced test case for this. I don't see it crashing right now on the same test when it was crashing before

Re: [PATCH] D18136: boost-use-to-string check

2016-04-26 Thread Piotr Padlewski via cfe-commits
Prazek updated this revision to Diff 55077. Prazek marked an inline comment as done. Prazek added a comment. I hope it is final http://reviews.llvm.org/D18136 Files: clang-tidy/boost/BoostTidyModule.cpp clang-tidy/boost/CMakeLists.txt clang-tidy/boost/UseToStringCheck.cpp clang-tidy/boo

Re: [PATCH] D18136: boost-use-to-string check

2016-04-26 Thread Piotr Padlewski via cfe-commits
Prazek added a comment. Alex, if you accept this revision, please accept this also http://reviews.llvm.org/D18274 http://reviews.llvm.org/D18136 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/c

Re: [PATCH] D18136: boost-use-to-string check

2016-04-27 Thread Piotr Padlewski via cfe-commits
Prazek marked 4 inline comments as done. Prazek added a comment. http://reviews.llvm.org/D18136 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D18136: boost-use-to-string check

2016-04-27 Thread Piotr Padlewski via cfe-commits
Prazek updated this revision to Diff 55280. http://reviews.llvm.org/D18136 Files: clang-tidy/boost/BoostTidyModule.cpp clang-tidy/boost/CMakeLists.txt clang-tidy/boost/UseToStringCheck.cpp clang-tidy/boost/UseToStringCheck.h docs/ReleaseNotes.rst docs/clang-tidy/checks/boost-use-to-st

Re: [PATCH] D19183: [clang-tidy] Add modernize-make-shared check

2016-04-27 Thread Piotr Padlewski via cfe-commits
Prazek marked 3 inline comments as done. Prazek added a comment. Repository: rL LLVM http://reviews.llvm.org/D19183 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D18274: [clang-tidy] Add boost module

2016-04-27 Thread Piotr Padlewski via cfe-commits
Prazek updated this revision to Diff 55287. http://reviews.llvm.org/D18274 Files: clang-tidy/CMakeLists.txt clang-tidy/boost/BoostTidyModule.cpp clang-tidy/boost/CMakeLists.txt clang-tidy/plugin/CMakeLists.txt clang-tidy/tool/CMakeLists.txt clang-tidy/tool/ClangTidyMain.cpp docs/Rel

Re: [PATCH] D19183: [clang-tidy] Add modernize-make-shared check

2016-04-27 Thread Piotr Padlewski via cfe-commits
Prazek removed rL LLVM as the repository for this revision. Prazek updated this revision to Diff 55295. http://reviews.llvm.org/D19183 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/MakeSharedCheck.cpp clang-tidy/modernize/MakeSharedCheck.h clang-tidy/modernize/MakeSmartP

Re: [PATCH] D18136: boost-use-to-string check

2016-04-29 Thread Piotr Padlewski via cfe-commits
Prazek marked 2 inline comments as done. Comment at: clang-tidy/boost/UseToStringCheck.cpp:38 @@ +37,3 @@ + argumentCountIs(1), unless(isInTemplateInstantiation())) + .bind("to_string"), + this); alexfh wrote: > clang-format? nope, everythin

Re: [PATCH] D18274: [clang-tidy] Add boost module

2016-04-29 Thread Piotr Padlewski via cfe-commits
Prazek abandoned this revision. Prazek added a comment. Merged with boost-use-to-string http://reviews.llvm.org/D18274 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D18136: boost-use-to-string check

2016-04-29 Thread Piotr Padlewski via cfe-commits
Prazek updated this revision to Diff 8. Prazek marked an inline comment as done. Prazek added a comment. merged with boost module http://reviews.llvm.org/D18136 Files: clang-tidy/CMakeLists.txt clang-tidy/boost/BoostTidyModule.cpp clang-tidy/boost/CMakeLists.txt clang-tidy/boost/Use

Re: [PATCH] D19183: [clang-tidy] Add modernize-make-shared check

2016-04-29 Thread Piotr Padlewski via cfe-commits
Prazek added a subscriber: alexfh. Prazek added a comment. ping. @alexfh are you planning to take a look? http://reviews.llvm.org/D19183 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi

[clang-tools-extra] r268076 - small reformat to test access

2016-04-29 Thread Piotr Padlewski via cfe-commits
Author: prazek Date: Fri Apr 29 12:45:20 2016 New Revision: 268076 URL: http://llvm.org/viewvc/llvm-project?rev=268076&view=rev Log: small reformat to test access Modified: clang-tools-extra/trunk/clang-tidy/modernize/PassByValueCheck.cpp Modified: clang-tools-extra/trunk/clang-tidy/moderniz

[clang-tools-extra] r268079 - Add boost-use-to-string

2016-04-29 Thread Piotr Padlewski via cfe-commits
Author: prazek Date: Fri Apr 29 12:58:29 2016 New Revision: 268079 URL: http://llvm.org/viewvc/llvm-project?rev=268079&view=rev Log: Add boost-use-to-string http://reviews.llvm.org/D18136 Added: clang-tools-extra/trunk/clang-tidy/boost/ clang-tools-extra/trunk/clang-tidy/boost/BoostTidyM

[clang-tools-extra] r268253 - [clang-tidy] Add modernize-make-shared check

2016-05-02 Thread Piotr Padlewski via cfe-commits
Author: prazek Date: Mon May 2 11:56:39 2016 New Revision: 268253 URL: http://llvm.org/viewvc/llvm-project?rev=268253&view=rev Log: [clang-tidy] Add modernize-make-shared check Because modernize-make-shared do almost the same job as modernize-make-unique, I refactored common code to MakeSmartPtr

Re: [PATCH] D18919: [Clang-tidy] Add check "modernize use using"

2016-05-02 Thread Piotr Padlewski via cfe-commits
Prazek added a comment. lgtm, but I'd rather see Hokein acceptance. Repository: rL LLVM http://reviews.llvm.org/D18919 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D18919: [Clang-tidy] Add check "modernize use using"

2016-05-03 Thread Piotr Padlewski via cfe-commits
Prazek added inline comments. Comment at: clang-tidy/modernize/UseUsingCheck.cpp:22 @@ +21,3 @@ +void UseUsingCheck::registerMatchers(MatchFinder *Finder) { + if (!getLangOpts().CPlusPlus) +return; hokein wrote: > Should be CplusPlus11 here. BTW is there any

Re: [PATCH] D18919: [Clang-tidy] Add check "modernize use using"

2016-05-03 Thread Piotr Padlewski via cfe-commits
Prazek added inline comments. Comment at: clang-tidy/modernize/UseUsingCheck.cpp:22 @@ +21,3 @@ +void UseUsingCheck::registerMatchers(MatchFinder *Finder) { + if (!getLangOpts().CPlusPlus) +return; hokein wrote: > Prazek wrote: > > hokein wrote: > > > Should

Re: [PATCH] D19165: [clang-tidy] Add modernize-increment-bool check.

2016-05-03 Thread Piotr Padlewski via cfe-commits
Prazek added a comment. ping @Alexfh have you check it? http://reviews.llvm.org/D19165 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D18821: Add bugprone-bool-to-integer-conversion

2016-05-04 Thread Piotr Padlewski via cfe-commits
Prazek retitled this revision from "Add modernize-bool-to-integer-conversion" to "Add bugprone-bool-to-integer-conversion". Prazek updated this revision to Diff 56138. Prazek added a comment. It seems that it works right now. The other funny thing that the check found is cases like bool b; if (b

Re: [PATCH] D18919: [Clang-tidy] Add check "modernize use using"

2016-05-04 Thread Piotr Padlewski via cfe-commits
Prazek added a comment. In http://reviews.llvm.org/D18919#419902, @curdeius wrote: > I'm really interested in the manner this check works when a typedef has > multiple declarations in it (same example as in the comment): > > typedef int m_int, *m_int_p, &m_int_r, m_int_arr[10], (&m_int_fun)(in

Re: [PATCH] D19105: Changes in clang after running http://reviews.llvm.org/D18821

2016-05-05 Thread Piotr Padlewski via cfe-commits
Prazek updated this revision to Diff 56250. Prazek added a comment. Herald added a reviewer: tstellarAMD. Herald added subscribers: jfb, mzolotukhin, dsanders, arsenm, MatzeB. It seems that is doing it's work right now. I will have to change some places to post it to llvm like: - changing functi

Re: [PATCH] D18821: Add bugprone-bool-to-integer-conversion

2016-05-05 Thread Piotr Padlewski via cfe-commits
Prazek added a comment. Updated the diff with changes http://reviews.llvm.org/D19105 http://reviews.llvm.org/D18821 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D19105: Changes in clang after running http://reviews.llvm.org/D18821

2016-05-06 Thread Piotr Padlewski via cfe-commits
Prazek added a comment. In http://reviews.llvm.org/D19105#422702, @Quuxplusone wrote: > It seems like this proposed diagnostic and fixit, statistically speaking, is > *never* correct. > In the cases where there is a code issue to be corrected, the diagnosable > issue really seems to involve da

Re: [PATCH] D19105: Changes in clang after running http://reviews.llvm.org/D18821

2016-05-11 Thread Piotr Padlewski via cfe-commits
Prazek added a comment. In http://reviews.llvm.org/D19105#426903, @alexfh wrote: > returning a bool from a function that is declared to return a typedef to an > integral type that contains `bool` in its name (e.g. `LLVMBool`), and maybe > some other cases. Isn't it LLVMBool issue? I won't ha

Re: [PATCH] D19105: Changes in clang after running http://reviews.llvm.org/D18821

2016-05-11 Thread Piotr Padlewski via cfe-commits
Prazek added inline comments. Comment at: lib/Target/Hexagon/MCTargetDesc/HexagonMCShuffler.cpp:194 @@ -193,3 +193,3 @@ - if (doneShuffling == false) { + if (doneShuffling == 0) { HexagonMCShuffler MCS(MCII, STI, MCB); alexfh wrote: > This is wrong. Of co

Re: [PATCH] D18745: [clang-tidy] Adds modernize-use-bool-literals check.

2016-05-11 Thread Piotr Padlewski via cfe-commits
Prazek closed this revision. Prazek added a comment. gg for your first check :) http://reviews.llvm.org/D18745 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D18919: [Clang-tidy] Add check "modernize use using"

2016-05-12 Thread Piotr Padlewski via cfe-commits
Prazek added inline comments. Comment at: clang-tidy/modernize/UseUsingCheck.cpp:13 @@ +12,3 @@ +#include "clang/ASTMatchers/ASTMatchFinder.h" +#include + Is this required? Repository: rL LLVM http://reviews.llvm.org/D18919 ___

Re: [PATCH] D20053: [clang-tidy] Add misc-unnecessary-mutable check.

2016-05-12 Thread Piotr Padlewski via cfe-commits
Prazek added a reviewer: Prazek. Comment at: clang-tidy/misc/UnnecessaryMutableCheck.cpp:152 @@ +151,3 @@ +// it is the only declaration in a declaration chain. +static bool CheckRemoval(SourceManager &SM, const SourceLocation &LocStart, + const SourceLocat

Re: [PATCH] D19871: Add an AST matcher for CastExpr kind

2016-05-13 Thread Piotr Padlewski via cfe-commits
Prazek added a subscriber: Prazek. Prazek added a comment. +1 I will probably also use this. Does hasCastKind works for implicitCastExpr? http://reviews.llvm.org/D19871 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/c

Re: [PATCH] D20254: [Clang] Fix some Clang-tidy modernize-use-bool-literals warnings; other minor fixes.

2016-05-13 Thread Piotr Padlewski via cfe-commits
Prazek added a subscriber: Prazek. Prazek added a comment. Can you post this review with more context? (diff -U9) Repository: rL LLVM http://reviews.llvm.org/D20254 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org

Re: [PATCH] D18136: boost-use-to-string check

2016-04-01 Thread Piotr Padlewski via cfe-commits
Prazek updated the summary for this revision. Prazek updated this revision to Diff 52378. Prazek added a comment. Updated ReleaseNotes and also fixed bug. After lgtm please lgtm also this http://reviews.llvm.org/D18274 because I want to send them together, but in separate commits. http://review

Re: [PATCH] D18136: boost-use-to-string check

2016-04-01 Thread Piotr Padlewski via cfe-commits
Prazek marked an inline comment as done. Prazek added a comment. http://reviews.llvm.org/D18136 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D18745: [clang-tidy] Adds misc-use-bool-literals check.

2016-04-04 Thread Piotr Padlewski via cfe-commits
Prazek added a comment. In http://reviews.llvm.org/D18745#390739, @Eugene.Zelenko wrote: > Isn't readability-implicit-bool-cast¶ should catch such issues? If not, I > think will be good idea to improve that check instead of introducing new one. I wouldn't add this functionality there. I see th

Re: [PATCH] D18745: [clang-tidy] Adds modernize-use-bool-literals check.

2016-04-06 Thread Piotr Padlewski via cfe-commits
Prazek added a comment. So the testing on llvm shows mostly one case - using DEBUG macro like this: /home/prazek/llvm/lib/Support/APInt.cpp:1656:9: warning: implicitly converting integer literal to bool inside macro, use bool literal instead [modernize-use-bool-literals] DEBUG(dbgs() << " "

[PATCH] D18821: Add modernize-bool-to-integer-conversion

2016-04-06 Thread Piotr Padlewski via cfe-commits
Prazek created this revision. Prazek added reviewers: alexfh, staronj. Prazek added a subscriber: cfe-commits. Herald added a subscriber: joker.eph. Tested on llvm codebase. It have found many places like: - returning true/false in function returning int, - assigning true/false to integer inside

Re: [PATCH] D18821: Add modernize-bool-to-integer-conversion

2016-04-06 Thread Piotr Padlewski via cfe-commits
Prazek added a comment. Maybe we should merge it with http://reviews.llvm.org/D18745 and name it 'modernize-wrong-literal-cast'. The other question is, will it be better to move it to readability? http://reviews.llvm.org/D18821 ___ cfe-commits mai

Re: [PATCH] D18821: Add modernize-bool-to-integer-conversion

2016-04-06 Thread Piotr Padlewski via cfe-commits
Prazek marked an inline comment as done. Prazek added a comment. In http://reviews.llvm.org/D18821#393556, @mnbvmar wrote: > This check throws a warning also on the conversion to floats (probably very > rare ones): > > double number = true; > > > Even though this behavior is correct, the code

Re: [PATCH] D18821: Add modernize-bool-to-integer-conversion

2016-04-06 Thread Piotr Padlewski via cfe-commits
Prazek updated this revision to Diff 52851. Prazek marked an inline comment as done. http://reviews.llvm.org/D18821 Files: clang-tidy/modernize/BoolToIntegerConversionCheck.cpp clang-tidy/modernize/BoolToIntegerConversionCheck.h clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/Mod

Re: [PATCH] D18821: Add modernize-bool-to-integer-conversion

2016-04-06 Thread Piotr Padlewski via cfe-commits
Prazek updated this revision to Diff 52855. Prazek added a comment. Added new test cases http://reviews.llvm.org/D18821 Files: clang-tidy/modernize/BoolToIntegerConversionCheck.cpp clang-tidy/modernize/BoolToIntegerConversionCheck.h clang-tidy/modernize/CMakeLists.txt clang-tidy/moderni

Re: [PATCH] D18821: Add modernize-bool-to-integer-conversion

2016-04-07 Thread Piotr Padlewski via cfe-commits
Prazek added a comment. In http://reviews.llvm.org/D18821#394486, @alexfh wrote: > Actually, did you think about adding this as a clang diagnostic? > > Richard, what do you think about complaining in Clang about `int i = true;` > kind of code? Glad to hear that :) http://reviews.llvm.org/D18

Re: [PATCH] D18821: Add modernize-bool-to-integer-conversion

2016-04-09 Thread Piotr Padlewski via cfe-commits
Prazek updated this revision to Diff 53113. Prazek marked 2 inline comments as done. http://reviews.llvm.org/D18821 Files: clang-tidy/modernize/BoolToIntegerConversionCheck.cpp clang-tidy/modernize/BoolToIntegerConversionCheck.h clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/Mod

Re: [PATCH] D18821: Add modernize-bool-to-integer-conversion

2016-04-09 Thread Piotr Padlewski via cfe-commits
Prazek updated this revision to Diff 53114. Prazek marked 2 inline comments as done. Prazek added a comment. Used isMacroID to determinate if it's macro http://reviews.llvm.org/D18821 Files: clang-tidy/modernize/BoolToIntegerConversionCheck.cpp clang-tidy/modernize/BoolToIntegerConversionCh

Re: [PATCH] D18136: boost-use-to-string check

2016-04-09 Thread Piotr Padlewski via cfe-commits
Prazek updated the summary for this revision. Prazek updated this revision to Diff 53121. Prazek marked 5 inline comments as done. http://reviews.llvm.org/D18136 Files: clang-tidy/boost/BoostTidyModule.cpp clang-tidy/boost/CMakeLists.txt clang-tidy/boost/UseToStringCheck.cpp clang-tidy/bo

Re: [PATCH] D18919: Add check "modernize use using"

2016-04-09 Thread Piotr Padlewski via cfe-commits
Prazek added inline comments. Comment at: docs/clang-tidy/checks/modernize-use-using.rst:13 @@ +12,3 @@ + typedef int variable; + +After: add cases with pointers to function / members http://reviews.llvm.org/D18919 ___

Re: [PATCH] D18919: [Clang-tidy] Add check "modernize use using"

2016-04-09 Thread Piotr Padlewski via cfe-commits
Prazek added inline comments. Comment at: clang-tidy/modernize/UseUsingCheck.cpp:26 @@ +25,3 @@ +/// AST representation of type. +std::string removeExtraASTWords(std::string subject) { + std::pair subs[] = { add static Comment at: clang-tidy/mo

Re: [PATCH] D18821: Add modernize-bool-to-integer-conversion

2016-04-12 Thread Piotr Padlewski via cfe-commits
Prazek added a comment. In http://reviews.llvm.org/D18821#398843, @alexfh wrote: > BTW, why is the check in the 'modernize' module? It doesn't seem to make > anything more modern. I would guess, the pattern it detects is most likely to > result from a programming error. Also, the fix, though it

Re: [PATCH] D18821: Add modernize-bool-to-integer-conversion

2016-04-13 Thread Piotr Padlewski via cfe-commits
Prazek added a comment. In http://reviews.llvm.org/D18821#399079, @alexfh wrote: > In http://reviews.llvm.org/D18821#399064, @Prazek wrote: > > > In http://reviews.llvm.org/D18821#398843, @alexfh wrote: > > > > > BTW, why is the check in the 'modernize' module? It doesn't seem to make > > > anyt

Re: [PATCH] D19059: Reorder ASTNodeKind::AllKindInfo to match NodeKindId.

2016-04-14 Thread Piotr Padlewski via cfe-commits
Prazek added a subscriber: Prazek. Prazek added a comment. Does it solve my problem with isInTemplateInstantiation? :) Repository: rL LLVM http://reviews.llvm.org/D19059 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.or

Re: [PATCH] D19105: Changes in clang after running http://reviews.llvm.org/D18821

2016-04-14 Thread Piotr Padlewski via cfe-commits
Prazek added a comment. In http://reviews.llvm.org/D19105#400966, @thakis wrote: > > I want to replace all unsigned that are 1 bits with bool. > > > MSVC only packs bitfields of the same type together, so doing that change > would make clang use much more memory on Windows. Seriously MSVC? Ser

Re: [PATCH] D18821: Add modernize-bool-to-integer-conversion

2016-04-14 Thread Piotr Padlewski via cfe-commits
Prazek added a comment. http://reviews.llvm.org/D19105 Here is a diff containing fixes for clang. What I see is that it would be nice to detect bitfields of 1 bit and treet it as bool, so it won't warn it such cases. http://reviews.llvm.org/D18821 ___

Re: [PATCH] D18136: boost-use-to-string check

2016-04-15 Thread Piotr Padlewski via cfe-commits
Prazek updated the summary for this revision. Prazek updated this revision to Diff 53891. Prazek added a comment. Small tests update. Ping me when your patch will be in trunk http://reviews.llvm.org/D18136 Files: clang-tidy/boost/BoostTidyModule.cpp clang-tidy/boost/CMakeLists.txt clang-t

Re: [PATCH] D18821: Add modernize-bool-to-integer-conversion

2016-04-15 Thread Piotr Padlewski via cfe-commits
Prazek updated the summary for this revision. Prazek updated this revision to Diff 53909. Prazek marked an inline comment as done. Prazek added a comment. I will think name for new module that would have all the checks like this. I added ingnoring of bitfields of size 1 http://reviews.llvm.org/D

Re: [PATCH] D18821: Add modernize-bool-to-integer-conversion

2016-04-15 Thread Piotr Padlewski via cfe-commits
Prazek added a comment. In http://reviews.llvm.org/D18821#398843, @alexfh wrote: > BTW, why is the check in the 'modernize' module? It doesn't seem to make > anything more modern. I would guess, the pattern it detects is most likely to > result from a programming error. Also, the fix, though it

[PATCH] D19183: [clang-tidy] Add modernize-make-shared check

2016-04-15 Thread Piotr Padlewski via cfe-commits
Prazek created this revision. Prazek added reviewers: alexfh, mnbvmar, staronj, krystyna, angelgarcia. Prazek added a subscriber: cfe-commits. Because modernize-make-shared do almos the same job, I refactored common code to MakeSmartPtrCheck. http://reviews.llvm.org/D19183 Files: clang-tidy/

Re: [PATCH] D19165: [clang-tidy] Add modernize-increment-bool check.

2016-04-15 Thread Piotr Padlewski via cfe-commits
Prazek added a comment. In http://reviews.llvm.org/D19165#402657, @aaron.ballman wrote: > This strikes me as something the compiler should diagnose instead of a > clang-tidy check. Incrementing a bool has been deprecated for some time, but > it is outright removed in C++17, so I think giving us

Re: [PATCH] D19165: [clang-tidy] Add modernize-increment-bool check.

2016-04-15 Thread Piotr Padlewski via cfe-commits
Prazek added a comment. Besides comments, looks good to me. But before posting make sure that clang-diagnostics doesn't already have fixits. Comment at: clang-tidy/modernize/IncrementBoolCheck.cpp:51 @@ +50,3 @@ + // Don't fix if expression type is dependent on template initia

Re: [PATCH] D18821: Add modernize-bool-to-integer-conversion

2016-04-15 Thread Piotr Padlewski via cfe-commits
Prazek added a comment. In http://reviews.llvm.org/D18821#403103, @Quuxplusone wrote: > I would like to see a new version of http://reviews.llvm.org/D19105 with all > the "1-bit-bitfield" diffs removed. > Right now, it's hard to see that there's *anything* in > http://reviews.llvm.org/D19105 t

Re: [PATCH] D18821: Add modernize-bool-to-integer-conversion

2016-04-15 Thread Piotr Padlewski via cfe-commits
Prazek added a comment. In http://reviews.llvm.org/D18821#402686, @Prazek wrote: > In http://reviews.llvm.org/D18821#398843, @alexfh wrote: > > > BTW, why is the check in the 'modernize' module? It doesn't seem to make > > anything more modern. I would guess, the pattern it detects is most likel

Re: [PATCH] D19165: [clang-tidy] Add modernize-increment-bool check.

2016-04-16 Thread Piotr Padlewski via cfe-commits
Prazek added a comment. In http://reviews.llvm.org/D19165#403243, @alexfh wrote: > In http://reviews.llvm.org/D19165#403099, @Prazek wrote: > > > In http://reviews.llvm.org/D19165#402657, @aaron.ballman wrote: > > > > > This strikes me as something the compiler should diagnose instead of a > > >

Re: [PATCH] D18136: boost-use-to-string check

2016-04-16 Thread Piotr Padlewski via cfe-commits
Prazek added inline comments. Comment at: clang-tidy/boost/UseToStringCheck.cpp:59 @@ +58,3 @@ + + if (CharType.isNull()) +return; alexfh wrote: > When can `CharType` be `isNull()`? Do you have a test case for this? I think it's because of some libstdc++ impl

Re: [PATCH] D19183: [clang-tidy] Add modernize-make-shared check

2016-04-19 Thread Piotr Padlewski via cfe-commits
Prazek added a comment. ping Repository: rL LLVM http://reviews.llvm.org/D19183 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D19183: [clang-tidy] Add modernize-make-shared check

2016-04-24 Thread Piotr Padlewski via cfe-commits
Prazek added inline comments. Comment at: test/clang-tidy/modernize-make-shared.cpp:81 @@ +80,3 @@ + + std::shared_ptr R(new int()); + hokein wrote: > Why can't this case convert to `std::shared_ptr R = > std::make_shared(new int())`? You mean std::shared_ptr R

Re: [PATCH] D18442: A clang-tidy check for std:accumulate.

2016-04-25 Thread Piotr Padlewski via cfe-commits
Prazek added a subscriber: Prazek. Comment at: docs/clang-tidy/checks/misc-fold-init-type.rst:16-17 @@ +15,4 @@ + +.. code:: c++ + auto a = {0.5f, 0.5f, 0.5f, 0.5f}; + return std::accumulate(std::begin(a), std::end(a), 0); Doesn't .. code node need new line? h

Re: [PATCH] D20365: [PATCH] clang-tidy: Bug 27731 - modernize-pass-by-value suggest using std::move for types that perform copies on move

2016-05-21 Thread Piotr Padlewski via cfe-commits
Prazek added a subscriber: Prazek. Prazek added a comment. You have to push it by yourself. It's ain't fun if someone do it for you :D You have to obtain commit access http://llvm.org/docs/DeveloperPolicy.html#obtaining-commit-access and then push it (you can also find in docs how to do it) Tha

Re: [PATCH] D20277: [clang-tidy] UnnecessaryValueParamCheck - suggest std::move() if non-const value parameter can be moved.

2016-05-23 Thread Piotr Padlewski via cfe-commits
Prazek added a subscriber: Prazek. Prazek added a comment. Cool check! Did you think about sugesting std::move for rvalue references if they are used once? http://reviews.llvm.org/D20277 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http:

Re: [PATCH] D18821: Add bugprone-bool-to-integer-conversion

2016-05-23 Thread Piotr Padlewski via cfe-commits
Prazek updated this revision to Diff 58148. Prazek added a comment. +Fixed bug with operators + added fixup for function return type I will post changes on clang tomorrow http://reviews.llvm.org/D18821 Files: clang-tidy/CMakeLists.txt clang-tidy/bugprone/BoolToIntegerConversionCheck.cpp

Re: [clang-tools-extra] r270472 - Commiting for http://reviews.llvm.org/D20365

2016-05-23 Thread Piotr Padlewski via cfe-commits
BTW why did you revert this change? And why the commit message doesn't have "revert" in name? 2016-05-23 20:51 GMT+02:00 Nico Weber via cfe-commits < cfe-commits@lists.llvm.org>: > Next time, please use real commit messages: Describe what the change does, > and why it's being done. Include a link

Re: [PATCH] D20365: [PATCH] clang-tidy: Bug 27731 - modernize-pass-by-value suggest using std::move for types that perform copies on move

2016-05-23 Thread Piotr Padlewski via cfe-commits
Prazek added a comment. Did you revert the commit? I see that it is commieted, but after it I see revert. Also please stick to convention of commit messages http://llvm.org/docs/DeveloperPolicy.html#commit-messages Commit message like "[clang-tidy] modernize-pass-by-value bugfix" would be much

Re: [PATCH] D18821: Add bugprone-bool-to-integer-conversion

2016-05-24 Thread Piotr Padlewski via cfe-commits
Prazek updated this revision to Diff 58309. Prazek added a comment. Some small bugfixes afeter running it on llvm http://reviews.llvm.org/D18821 Files: clang-tidy/CMakeLists.txt clang-tidy/bugprone/BoolToIntegerConversionCheck.cpp clang-tidy/bugprone/BoolToIntegerConversionCheck.h clang

Re: [PATCH] D19105: Changes in clang after running http://reviews.llvm.org/D18821

2016-05-24 Thread Piotr Padlewski via cfe-commits
Prazek updated this revision to Diff 58313. Prazek added a comment. Herald added a reviewer: deadalnix. Fixed many stuff. Note that I won't push this patch mainly because of LLVMBool stuff and some other small issues. I don't think there can be done anything more for this check. http://review

Re: [PATCH] D19105: Changes in clang after running http://reviews.llvm.org/D18821

2016-05-25 Thread Piotr Padlewski via cfe-commits
Prazek added inline comments. Comment at: include/llvm-c/Core.h:604 @@ -603,3 +603,3 @@ */ -LLVMBool LLVMPrintModuleToFile(LLVMModuleRef M, const char *Filename, +bool LLVMPrintModuleToFile(LLVMModuleRef M, const char *Filename, char **ErrorMessag

Re: [PATCH] D18821: Add bugprone-bool-to-integer-conversion

2016-05-30 Thread Piotr Padlewski via cfe-commits
Prazek updated this revision to Diff 58961. Prazek added a comment. aborting with virtual functions http://reviews.llvm.org/D18821 Files: clang-tidy/CMakeLists.txt clang-tidy/bugprone/BoolToIntegerConversionCheck.cpp clang-tidy/bugprone/BoolToIntegerConversionCheck.h clang-tidy/bugprone

Re: [PATCH] D20277: [clang-tidy] UnnecessaryValueParamCheck - suggest std::move() if non-const value parameter can be moved.

2016-05-31 Thread Piotr Padlewski via cfe-commits
Prazek added a comment. In http://reviews.llvm.org/D20277#436725, @flx wrote: > In http://reviews.llvm.org/D20277#436717, @Prazek wrote: > > > Cool check! Did you think about sugesting std::move for rvalue references > > if they are used once? > > > Thanks! I'm not sure this fits with what a use

r271288 - [ASTMatchers] Breaking change of `has` matcher

2016-05-31 Thread Piotr Padlewski via cfe-commits
Author: prazek Date: Tue May 31 10:25:05 2016 New Revision: 271288 URL: http://llvm.org/viewvc/llvm-project?rev=271288&view=rev Log: [ASTMatchers] Breaking change of `has` matcher has matcher can now match to implicit and paren casts http://reviews.llvm.org/D20801 Modified: cfe/trunk/docs/R

[clang-tools-extra] r271289 - [ASTMatchers] Added ignoringParenImpCasts to has matchers

2016-05-31 Thread Piotr Padlewski via cfe-commits
Author: prazek Date: Tue May 31 10:26:56 2016 New Revision: 271289 URL: http://llvm.org/viewvc/llvm-project?rev=271289&view=rev Log: [ASTMatchers] Added ignoringParenImpCasts to has matchers has matcher changed behaviour, and now it matches "as is" and doesn't skip implicit and paren casts http:

Re: r271288 - [ASTMatchers] Breaking change of `has` matcher

2016-05-31 Thread Piotr Padlewski via cfe-commits
Yep, sending fix 2016-05-31 17:45 GMT+02:00 Rafael Espíndola : > This broke the build: > > http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/36968/steps/cmake-configure/logs/stdio > > On 31 May 2016 at 08:25, Piotr Padlewski via cfe-commits > wrote: > >

Re: r271288 - [ASTMatchers] Breaking change of `has` matcher

2016-05-31 Thread Piotr Padlewski via cfe-commits
/builds/36968/steps/cmake-configure/logs/stdio >> >> On 31 May 2016 at 08:25, Piotr Padlewski via cfe-commits >> wrote: >> > Author: prazek >> > Date: Tue May 31 10:25:05 2016 >> > New Revision: 271288 >> > >> > URL: http://llvm.org/vie

r271293 - Fixed bug

2016-05-31 Thread Piotr Padlewski via cfe-commits
Author: prazek Date: Tue May 31 10:56:26 2016 New Revision: 271293 URL: http://llvm.org/viewvc/llvm-project?rev=271293&view=rev Log: Fixed bug Modified: cfe/trunk/include/clang/CMakeLists.txt Modified: cfe/trunk/include/clang/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/cfe/trunk

Re: r271288 - [ASTMatchers] Breaking change of `has` matcher

2016-05-31 Thread Piotr Padlewski via cfe-commits
16-05-31 17:45 GMT+02:00 Rafael Espíndola >: > >>> > >>> This broke the build: > >>> > >>> > http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/36968/steps/cmake-configure/logs/stdio > >>> > >>> On 31 May 201

<    1   2   3   4   >