[PATCH] D27806: [clang-tidy] Add obvious-invalid-range

2016-12-26 Thread Arthur O'Dwyer via Phabricator via cfe-commits
Quuxplusone added inline comments. Comment at: clang-tidy/obvious/InvalidRangeCheck.cpp:62 + auto CallsAlgorithm = hasDeclaration( + functionDecl(Names.size() > 0 ? hasAnyName(Names) : anything())); + Prazek wrote: > alexfh wrote: > > Does this check make

[PATCH] D27806: [clang-tidy] Add obvious-invalid-range

2016-12-23 Thread Piotr Padlewski via Phabricator via cfe-commits
Prazek added inline comments. Comment at: clang-tidy/obvious/InvalidRangeCheck.cpp:62 + auto CallsAlgorithm = hasDeclaration( + functionDecl(Names.size() > 0 ? hasAnyName(Names) : anything())); + alexfh wrote: > Does this check make sense without the

[PATCH] D27806: [clang-tidy] Add obvious-invalid-range

2016-12-23 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/obvious/InvalidRangeCheck.cpp:38 + +const auto CXX11_AlgorithmNames = +CXX_AlgorithmNames + "; " No global `auto` variables, please. In this case `auto` just isn't buying you anything, but in other cases

[PATCH] D27806: [clang-tidy] Add obvious-invalid-range

2016-12-19 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang-tidy/obvious/InvalidRangeCheck.cpp:20-36 +"std::for_each; std::find; std::find_if; std::find_end; " +"std::find_first_of; std::adjacent_find; std::count; std::count_if;" +"std::mismatch; std::equal; std::search;

[PATCH] D27806: [clang-tidy] Add obvious-invalid-range

2016-12-16 Thread Piotr Padlewski via Phabricator via cfe-commits
Prazek added inline comments. Comment at: clang-tidy/obvious/InvalidRangeCheck.cpp:20-36 +"std::for_each; std::find; std::find_if; std::find_end; " +"std::find_first_of; std::adjacent_find; std::count; std::count_if;" +"std::mismatch; std::equal; std::search;

[PATCH] D27806: [clang-tidy] Add obvious-invalid-range

2016-12-16 Thread Piotr Padlewski via Phabricator via cfe-commits
Prazek marked an inline comment as done. Prazek added inline comments. Comment at: clang-tidy/obvious/InvalidRangeCheck.cpp:20-36 +"std::for_each; std::find; std::find_if; std::find_end; " +"std::find_first_of; std::adjacent_find; std::count; std::count_if;" +

[PATCH] D27806: [clang-tidy] Add obvious-invalid-range

2016-12-16 Thread Stanisław Barzowski via Phabricator via cfe-commits
sbarzowski added inline comments. Comment at: clang-tidy/obvious/InvalidRangeCheck.cpp:20-36 +"std::for_each; std::find; std::find_if; std::find_end; " +"std::find_first_of; std::adjacent_find; std::count; std::count_if;" +"std::mismatch; std::equal; std::search;

[PATCH] D27806: [clang-tidy] Add obvious-invalid-range

2016-12-16 Thread Piotr Padlewski via Phabricator via cfe-commits
Prazek marked 2 inline comments as done. Prazek added inline comments. Comment at: clang-tidy/obvious/InvalidRangeCheck.cpp:20-36 +"std::for_each; std::find; std::find_if; std::find_end; " +"std::find_first_of; std::adjacent_find; std::count; std::count_if;" +

[PATCH] D27806: [clang-tidy] Add obvious-invalid-range

2016-12-16 Thread Stanisław Barzowski via Phabricator via cfe-commits
sbarzowski requested changes to this revision. sbarzowski added inline comments. This revision now requires changes to proceed. Comment at: clang-tidy/obvious/InvalidRangeCheck.cpp:20-36 +"std::for_each; std::find; std::find_if; std::find_end; " +"std::find_first_of;

[PATCH] D27806: [clang-tidy] Add obvious-invalid-range

2016-12-16 Thread Jakub Staroń via Phabricator via cfe-commits
staronj added inline comments. Comment at: clang-tidy/misc/InvalidRangeCheck.cpp:19 + +const std::string CXX_AlgorithmNames = +"std::for_each; std::find; std::find_if; std::find_end; " Remove std::fill_n (http://en.cppreference.com/w/cpp/algorithm/fill_n) -

[PATCH] D27806: [clang-tidy] Add obvious-invalid-range

2016-12-16 Thread Piotr Padlewski via Phabricator via cfe-commits
Prazek added a comment. In https://reviews.llvm.org/D27806#624675, @Eugene.Zelenko wrote: > It may be good idea to create LLVM check which will suggest to use > STLExtras.h wrappers instead of STL algorithms. Sure, I actually didn't know about STLExtras, but anyway it would be something LLVM

[PATCH] D27806: [clang-tidy] Add obvious-invalid-range

2016-12-15 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added a comment. It may be good idea to create LLVM check which will suggest to use STLExtras.h wrappers instead of STL algorithms. https://reviews.llvm.org/D27806 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D27806: [clang-tidy] Add obvious-invalid-range

2016-12-15 Thread Piotr Padlewski via Phabricator via cfe-commits
Prazek added inline comments. Comment at: docs/clang-tidy/checks/list.rst:68 misc-inefficient-algorithm + misc-invalid-range misc-macro-parentheses malcolm.parsons wrote: > Prazek wrote: > > malcolm.parsons wrote: > > > misc. > > > add_new_check.py can

[PATCH] D27806: [clang-tidy] Add obvious-invalid-range

2016-12-15 Thread Malcolm Parsons via Phabricator via cfe-commits
malcolm.parsons added inline comments. Comment at: docs/clang-tidy/checks/list.rst:68 misc-inefficient-algorithm + misc-invalid-range misc-macro-parentheses Prazek wrote: > malcolm.parsons wrote: > > misc. > > add_new_check.py can fix it. > How? I

[PATCH] D27806: [clang-tidy] Add obvious-invalid-range

2016-12-15 Thread Piotr Padlewski via Phabricator via cfe-commits
Prazek added a comment. Also please review https://reviews.llvm.org/D27815 to make it happen https://reviews.llvm.org/D27806 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D27806: [clang-tidy] Add obvious-invalid-range

2016-12-15 Thread Piotr Padlewski via Phabricator via cfe-commits
Prazek updated this revision to Diff 81617. Prazek marked an inline comment as done. Prazek added a comment. - Small fixes https://reviews.llvm.org/D27806 Files: clang-tidy/obvious/CMakeLists.txt clang-tidy/obvious/InvalidRangeCheck.cpp clang-tidy/obvious/InvalidRangeCheck.h

[PATCH] D27806: [clang-tidy] Add obvious-invalid-range

2016-12-15 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tidy/misc/InvalidRangeCheck.cpp:78 +void InvalidRangeCheck::check(const MatchFinder::MatchResult ) { + + const auto *FirstArg = Result.Nodes.getNodeAs("first_arg"); Please remove empty line.

[PATCH] D27806: [clang-tidy] Add obvious-invalid-range

2016-12-15 Thread Piotr Padlewski via Phabricator via cfe-commits
Prazek added inline comments. Comment at: docs/clang-tidy/checks/list.rst:68 misc-inefficient-algorithm + misc-invalid-range misc-macro-parentheses malcolm.parsons wrote: > misc. > add_new_check.py can fix it. How? I added new check with this script,

[PATCH] D27806: [clang-tidy] Add obvious-invalid-range

2016-12-15 Thread Malcolm Parsons via Phabricator via cfe-commits
malcolm.parsons added inline comments. Comment at: docs/clang-tidy/checks/list.rst:68 misc-inefficient-algorithm + misc-invalid-range misc-macro-parentheses misc. add_new_check.py can fix it. https://reviews.llvm.org/D27806

[PATCH] D27806: [clang-tidy] Add obvious-invalid-range

2016-12-15 Thread Piotr Padlewski via Phabricator via cfe-commits
Prazek added inline comments. Comment at: test/clang-tidy/misc-invalid-range.cpp:41 + auto = v; + std::move(v.begin(), v2.end(), v2.begin()); + // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: call to algorithm with begin and end from different objects [misc-invalid-range]

[PATCH] D27806: [clang-tidy] Add obvious-invalid-range

2016-12-15 Thread Piotr Padlewski via Phabricator via cfe-commits
Prazek updated this revision to Diff 81606. Prazek added a comment. - Small fixes https://reviews.llvm.org/D27806 Files: clang-tidy/obvious/CMakeLists.txt clang-tidy/obvious/InvalidRangeCheck.cpp clang-tidy/obvious/InvalidRangeCheck.h clang-tidy/obvious/ObviousTidyModule.cpp

[PATCH] D27806: [clang-tidy] Add obvious-invalid-range

2016-12-15 Thread Malcolm Parsons via Phabricator via cfe-commits
malcolm.parsons added inline comments. Comment at: test/clang-tidy/misc-invalid-range.cpp:41 + auto = v; + std::move(v.begin(), v2.end(), v2.begin()); + // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: call to algorithm with begin and end from different objects

[PATCH] D27806: [clang-tidy] Add obvious-invalid-range

2016-12-15 Thread Malcolm Parsons via Phabricator via cfe-commits
malcolm.parsons added a comment. In https://reviews.llvm.org/D27806#623856, @Prazek wrote: > So does FIXIT comment satisfies you for this patch? Yes. Comment at: clang-tidy/obvious/InvalidRangeCheck.cpp:80 +void InvalidRangeCheck::check(const MatchFinder::MatchResult ) { +

[PATCH] D27806: [clang-tidy] Add obvious-invalid-range

2016-12-15 Thread Piotr Padlewski via Phabricator via cfe-commits
Prazek updated this revision to Diff 81604. Prazek added a comment. - Small fixes https://reviews.llvm.org/D27806 Files: clang-tidy/obvious/CMakeLists.txt clang-tidy/obvious/InvalidRangeCheck.cpp clang-tidy/obvious/InvalidRangeCheck.h clang-tidy/obvious/ObviousTidyModule.cpp

[PATCH] D27806: [clang-tidy] Add obvious-invalid-range

2016-12-15 Thread Piotr Padlewski via Phabricator via cfe-commits
Prazek marked an inline comment as done. Prazek added a comment. In https://reviews.llvm.org/D27806#623838, @malcolm.parsons wrote: > What about arguments 3 and 4 of `std::list::splice(It, list, It, It)`? I am aware of that, but I wanted to make a bunch of simple checks to fill obvious module

[PATCH] D27806: [clang-tidy] Add obvious-invalid-range

2016-12-15 Thread Piotr Padlewski via Phabricator via cfe-commits
Prazek updated this revision to Diff 81603. Prazek marked 2 inline comments as done. Prazek added a comment. - Small fixes https://reviews.llvm.org/D27806 Files: clang-tidy/obvious/CMakeLists.txt clang-tidy/obvious/InvalidRangeCheck.cpp clang-tidy/obvious/InvalidRangeCheck.h

[PATCH] D27806: [clang-tidy] Add obvious-invalid-range

2016-12-15 Thread Piotr Padlewski via Phabricator via cfe-commits
Prazek marked 3 inline comments as done. Prazek added inline comments. Comment at: docs/ReleaseNotes.rst:84 +- New `misc-invalid-range + `_ check malcolm.parsons wrote: > Prazek wrote: >

[PATCH] D27806: [clang-tidy] Add obvious-invalid-range

2016-12-15 Thread Malcolm Parsons via Phabricator via cfe-commits
malcolm.parsons added a comment. What about arguments 3 and 4 of `std::list::splice(It, list, It, It)`? Comment at: clang-tidy/obvious/ObviousTidyModule.cpp:24 void addCheckFactories(ClangTidyCheckFactories ) override { -// Add obvious checks here. +