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

2016-04-26 Thread Alexander Kornienko via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL267542: A clang-tidy check for std:accumulate. (authored by alexfh). Changed prior to commit: http://reviews.llvm.org/D18442?vs=54969&id=54978#toc Repository: rL LLVM http://reviews.llvm.org/D18442

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

2016-04-26 Thread Clement Courbet via cfe-commits
courbet added a comment. In http://reviews.llvm.org/D18442#411785, @alexfh wrote: > Looks good now. Thank you for the new check! Thanks for the review. > Do you need me to submit the patch for you? Yes, please. http://reviews.llvm.org/D18442 _

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

2016-04-26 Thread Alexander Kornienko via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. Looks good now. Thank you for the new check! Do you need me to submit the patch for you? http://reviews.llvm.org/D18442 ___ cfe-commits mailing

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

2016-04-26 Thread Clement Courbet via cfe-commits
courbet added inline comments. 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); alexfh wrote: > Prazek wrote: > > Doesn't .

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

2016-04-26 Thread Clement Courbet via cfe-commits
courbet updated this revision to Diff 54969. courbet marked 2 inline comments as done. courbet added a comment. Fix doc formatting and add more doc. http://reviews.llvm.org/D18442 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/FoldInitTypeCheck.cpp clang-tidy/misc/FoldInitTypeCheck

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

2016-04-25 Thread Alexander Kornienko via cfe-commits
alexfh added a comment. A few nits. Comment at: clang-tidy/misc/FoldInitTypeCheck.cpp:90 @@ +89,3 @@ + // It's OK to fold an int into: + // - an int of the same size and signedness. + // - a bigger int, regardless of signedness. No, I don't have a better na

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] D18442: A clang-tidy check for std:accumulate.

2016-04-25 Thread Clement Courbet via cfe-commits
courbet updated this revision to Diff 54833. courbet marked 3 inline comments as done. courbet added a comment. Refactoring matchers & cosmetics. http://reviews.llvm.org/D18442 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/FoldInitTypeCheck.cpp clang-tidy/misc/FoldInitTypeCheck.h

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

2016-04-25 Thread Clement Courbet via cfe-commits
courbet added inline comments. Comment at: clang-tidy/misc/FoldInitTypeCheck.cpp:89 @@ +88,3 @@ + +/// Returns true if ValueType is allowed to fold into InitType, i.e. if: +/// static_cast(ValueType{some_value}) alexfh wrote: > Is "fold" a commonly used term in

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

2016-04-21 Thread Alexander Kornienko via cfe-commits
alexfh requested changes to this revision. This revision now requires changes to proceed. Comment at: clang-tidy/misc/FoldInitTypeCheck.cpp:23 @@ +22,3 @@ + // Note: Right now we check only builtin types. + const auto BuiltinTypeWithId = [](const char *id) { +return hasCanon

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

2016-04-18 Thread Clement Courbet via cfe-commits
courbet added a comment. Thanks, PTAL. Comment at: clang-tidy/misc/FoldInitTypeCheck.cpp:21 @@ +20,3 @@ +/// Returns the value_type for an InputIterator type. +static QualType getInputIteratorValueType(const Type &IteratorType, + const AS

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

2016-04-18 Thread Clement Courbet via cfe-commits
courbet updated the summary for this revision. courbet updated this revision to Diff 54045. courbet marked 7 inline comments as done. courbet added a comment. - Use matchers for most of the check logic, - Implement checking for reduce and inner_product, - more tests. http://reviews.llvm.org/D184

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

2016-04-05 Thread Aaron Ballman via cfe-commits
aaron.ballman added a subscriber: aaron.ballman. Comment at: clang-tidy/misc/FoldInitTypeCheck.cpp:21 @@ +20,3 @@ +/// Returns the value_type for an InputIterator type. +static QualType getInputIteratorValueType(const Type &IteratorType, +

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

2016-04-01 Thread Alexander Kornienko via cfe-commits
alexfh added a comment. Sorry for the delay (mostly due to the holidays here). The check looks very useful, at least, the pattern is hard to spot by manual inspection. A few comments though, mostly style-related. Comment at: clang-tidy/misc/FoldInitTypeCheck.cpp:21 @@ +20,3 @@

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

2016-03-31 Thread Clement Courbet via cfe-commits
courbet added a comment. ping ? http://reviews.llvm.org/D18442 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits