[PATCH] D25316: [clang-tidy] Fix PR25499: Enhance modernize-use-auto to casts

2016-10-09 Thread Piotr Padlewski via cfe-commits
Prazek added a comment. BTW I think changing the commit name by removing bug ID would be good, because it would be more clear that this is a feature commit, not a bug fix. You can move t he bug id, or the link to bug to the summary section. https://reviews.llvm.org/D25316 __

[PATCH] D25316: [clang-tidy] Fix PR25499: Enhance modernize-use-auto to casts

2016-10-09 Thread Piotr Padlewski via cfe-commits
Prazek added inline comments. Comment at: test/clang-tidy/modernize-use-auto-cast-remove-stars.cpp:25 + // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use auto when initializing with a cast to avoid duplicating the type name + // CHECK-FIXES: auto ll = static_cast(l); + unsigne

[PATCH] D25316: [clang-tidy] Fix PR25499: Enhance modernize-use-auto to casts

2016-10-09 Thread Piotr Padlewski via cfe-commits
Prazek added a comment. In https://reviews.llvm.org/D25316#565574, @malcolm.parsons wrote: > In https://reviews.llvm.org/D25316#565567, @Prazek wrote: > > > functionDecl(hasName(LEXICAL_CAST_NAME), > > > I was trying to avoid specifying the name of the function so that it works > for any t

[PATCH] D25316: [clang-tidy] Fix PR25499: Enhance modernize-use-auto to casts

2016-10-09 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added a comment. In https://reviews.llvm.org/D25316#565567, @Prazek wrote: > functionDecl(hasName(LEXICAL_CAST_NAME), I was trying to avoid specifying the name of the function so that it works for any templated function/member function that returns its first template type

[PATCH] D25316: [clang-tidy] Fix PR25499: Enhance modernize-use-auto to casts

2016-10-09 Thread Piotr Padlewski via cfe-commits
Prazek added a comment. In https://reviews.llvm.org/D25316#565463, @malcolm.parsons wrote: > In https://reviews.llvm.org/D25316#565378, @Prazek wrote: > > > Awesome to see this patch. After this one will make it to upstream, it will > > be much easier for me to do same with template functions. >

[PATCH] D25316: [clang-tidy] Fix PR25499: Enhance modernize-use-auto to casts

2016-10-08 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added a comment. In https://reviews.llvm.org/D25316#565378, @Prazek wrote: > Awesome to see this patch. After this one will make it to upstream, it will > be much easier for me to do same with template functions. I was trying to match such functions: varDecl(hasType(type().b

[PATCH] D25316: [clang-tidy] Fix PR25499: Enhance modernize-use-auto to casts

2016-10-08 Thread Piotr Padlewski via cfe-commits
Prazek added a comment. Awesome to see this patch. After this one will make it to upstream, it will be much easier for me to do same with template functions. Comment at: test/clang-tidy/modernize-use-auto-cast-remove-stars.cpp:2 +// RUN: %check_clang_tidy %s modernize-use-auto

[PATCH] D25316: [clang-tidy] Fix PR25499: Enhance modernize-use-auto to casts

2016-10-08 Thread Malcolm Parsons via cfe-commits
malcolm.parsons updated this revision to Diff 74022. malcolm.parsons added a comment. Rework handling of references https://reviews.llvm.org/D25316 Files: clang-tidy/modernize/UseAutoCheck.cpp clang-tidy/modernize/UseAutoCheck.h docs/clang-tidy/checks/modernize-use-auto.rst test/clang-t

[PATCH] D25316: [clang-tidy] Fix PR25499: Enhance modernize-use-auto to casts

2016-10-07 Thread Malcolm Parsons via cfe-commits
malcolm.parsons updated this revision to Diff 73918. malcolm.parsons added a comment. Add more tests. https://reviews.llvm.org/D25316 Files: clang-tidy/modernize/UseAutoCheck.cpp clang-tidy/modernize/UseAutoCheck.h docs/clang-tidy/checks/modernize-use-auto.rst test/clang-tidy/modernize-

[PATCH] D25316: [clang-tidy] Fix PR25499: Enhance modernize-use-auto to casts

2016-10-07 Thread Piotr Padlewski via cfe-commits
Prazek added a comment. In https://reviews.llvm.org/D25316#564217, @malcolm.parsons wrote: > In https://reviews.llvm.org/D25316#563930, @Prazek wrote: > > > Please add tests with > > > > long long p = static_cast(4); > > > > > > and the same with const at beginning. I remember I had problems

[PATCH] D25316: [clang-tidy] Fix PR25499: Enhance modernize-use-auto to casts

2016-10-07 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added a comment. In https://reviews.llvm.org/D25316#563930, @Prazek wrote: > Please add tests with > > long long p = static_cast(4); > > > and the same with const at beginning. I remember I had problems with this > last time (Type->SourceRange was returning only source range

[PATCH] D25316: [clang-tidy] Fix PR25499: Enhance modernize-use-auto to casts

2016-10-06 Thread Piotr Padlewski via cfe-commits
Prazek added a comment. Please add tests with long long p = static_cast(4); and the same with const at beginning. I remember I had problems with this last time (Type->SourceRange was returning only source range for the first token. I will review patch later. https://reviews.llvm.org/D25316

[PATCH] D25316: [clang-tidy] Fix PR25499: Enhance modernize-use-auto to casts

2016-10-06 Thread Malcolm Parsons via cfe-commits
malcolm.parsons updated this revision to Diff 73831. malcolm.parsons added a comment. Mention in release notes. https://reviews.llvm.org/D25316 Files: clang-tidy/modernize/UseAutoCheck.cpp clang-tidy/modernize/UseAutoCheck.h docs/clang-tidy/checks/modernize-use-auto.rst test/clang-tidy/

[PATCH] D25316: [clang-tidy] Fix PR25499: Enhance modernize-use-auto to casts

2016-10-06 Thread Eugene Zelenko via cfe-commits
Eugene.Zelenko added a comment. Please mention this enhancement in in docs/ReleaseNotes.rst (in alphabetical order). https://reviews.llvm.org/D25316 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listi

[PATCH] D25316: [clang-tidy] Fix PR25499: Enhance modernize-use-auto to casts

2016-10-06 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added a comment. In https://reviews.llvm.org/D25316#563654, @Eugene.Zelenko wrote: > I think will be good idea to handle LLVM casts and getAs<> methods too. There > are plenty of them in LLVM/Clang/etc code used for variable initialization. Yes. I plan to do that, but maybe in

[PATCH] D25316: [clang-tidy] Fix PR25499: Enhance modernize-use-auto to casts

2016-10-06 Thread Eugene Zelenko via cfe-commits
Eugene.Zelenko added a comment. I think will be good idea to handle LLVM casts and getAs<> methods too. There are plenty of them in LLVM/Clang/etc code used for variable initialization. See also https://reviews.llvm.org/D17765 for Boost related ideas. https://reviews.llvm.org/D25316 ___

[PATCH] D25316: [clang-tidy] Fix PR25499: Enhance modernize-use-auto to casts

2016-10-06 Thread Malcolm Parsons via cfe-commits
malcolm.parsons updated this revision to Diff 73780. malcolm.parsons added a comment. Add functional casts to tests and doc. https://reviews.llvm.org/D25316 Files: clang-tidy/modernize/UseAutoCheck.cpp clang-tidy/modernize/UseAutoCheck.h docs/clang-tidy/checks/modernize-use-auto.rst tes

[PATCH] D25316: [clang-tidy] Fix PR25499: Enhance modernize-use-auto to casts

2016-10-06 Thread Malcolm Parsons via cfe-commits
malcolm.parsons created this revision. malcolm.parsons added reviewers: angelgarcia, aaron.ballman, klimek. malcolm.parsons added subscribers: cfe-commits, Eugene.Zelenko. Extend modernize-use-auto to cases when variable is assigned with cast. e.g. Type *Ptr1 = dynamic_cast(Ptr2); https://revie