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

2016-10-31 Thread Aaron Ballman via cfe-commits
On Mon, Oct 31, 2016 at 2:55 PM, Malcolm Parsons wrote: > malcolm.parsons added inline comments. > > > > Comment at: clang-tidy/modernize/UseAutoCheck.cpp:404 > +[](const Expr *Expr) { return Expr->getType(); }, > +"use auto when initializing with n

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

2016-10-31 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added inline comments. Comment at: clang-tidy/modernize/UseAutoCheck.cpp:404 +[](const Expr *Expr) { return Expr->getType(); }, +"use auto when initializing with new to avoid " +"duplicating the type name");

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

2016-10-31 Thread Aaron Ballman via cfe-commits
aaron.ballman added inline comments. Comment at: clang-tidy/modernize/UseAutoCheck.cpp:404 +[](const Expr *Expr) { return Expr->getType(); }, +"use auto when initializing with new to avoid " +"duplicating the type name"); --

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

2016-10-31 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added a comment. In https://reviews.llvm.org/D25316#583651, @aaron.ballman wrote: > Does this check properly work in the presence of macros? Those are sometimes > more common in casting operations, so a few explicit tests would be good > (those tests could be follow-on work if i

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

2016-10-31 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added inline comments. Comment at: clang-tidy/modernize/UseAutoCheck.cpp:404 +[](const Expr *Expr) { return Expr->getType(); }, +"use auto when initializing with new to avoid " +"duplicating the type name");

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

2016-10-31 Thread Aaron Ballman via cfe-commits
aaron.ballman added a comment. Does this check properly work in the presence of macros? Those are sometimes more common in casting operations, so a few explicit tests would be good (those tests could be follow-on work if it turns out that this check doesn't play nicely with macros).

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

2016-10-31 Thread Malcolm Parsons via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL285579: [clang-tidy] Enhance modernize-use-auto to casts (authored by malcolm.parsons). Changed prior to commit: https://reviews.llvm.org/D25316?vs=76404&id=76405#toc Repository: rL LLVM https://rev

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

2016-10-31 Thread Malcolm Parsons via cfe-commits
malcolm.parsons updated this revision to Diff 76404. malcolm.parsons added a comment. Change doc to say "C-style casts". https://reviews.llvm.org/D25316 Files: clang-tidy/modernize/UseAutoCheck.cpp clang-tidy/modernize/UseAutoCheck.h docs/ReleaseNotes.rst docs/clang-tidy/checks/moderniz

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

2016-10-31 Thread Alexander Kornienko via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. Sorry for the delay. Feel free to ping earlier. One more comment, otherwise looks good. Comment at: docs/clang-tidy/checks/modernize-use-auto.rst:163 +The check handles ``st

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

2016-10-29 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added a comment. ping. https://reviews.llvm.org/D25316 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2016-10-13 Thread Malcolm Parsons via cfe-commits
malcolm.parsons updated this revision to Diff 74476. malcolm.parsons added a comment. Combine matchers https://reviews.llvm.org/D25316 Files: clang-tidy/modernize/UseAutoCheck.cpp clang-tidy/modernize/UseAutoCheck.h docs/ReleaseNotes.rst docs/clang-tidy/checks/modernize-use-auto.rst t

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

2016-10-10 Thread Alexander Kornienko via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/modernize/UseAutoCheck.cpp:252-254 + anyOf(hasType(autoType()), +hasType(pointerType(pointee(autoType(, +hasType(referenceType(pointee(autoType())

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

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

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

2016-10-10 Thread Malcolm Parsons via cfe-commits
malcolm.parsons updated this revision to Diff 74162. malcolm.parsons added a comment. Use std::function 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/moderniz

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

2016-10-10 Thread Alexander Kornienko via cfe-commits
alexfh requested changes to this revision. alexfh added inline comments. This revision now requires changes to proceed. Comment at: clang-tidy/modernize/UseAutoCheck.cpp:331 +void UseAutoCheck::replaceExpr(const DeclStmt *D, ASTContext *Context, + Ty

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

2016-10-10 Thread Malcolm Parsons via cfe-commits
malcolm.parsons marked 15 inline comments as done. malcolm.parsons added inline comments. Comment at: test/clang-tidy/modernize-use-auto-cast.cpp:14 + long l = 1; + int i1 = static_cast(l); + // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use auto when initializing with a cast t

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

2016-10-10 Thread Malcolm Parsons via cfe-commits
malcolm.parsons updated this revision to Diff 74134. malcolm.parsons added a comment. Fix ast matcher Add test Fix parameter case Inline lambdas Doc fixes https://reviews.llvm.org/D25316 Files: clang-tidy/modernize/UseAutoCheck.cpp clang-tidy/modernize/UseAutoCheck.h docs/clang-tidy/check

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

2016-10-10 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added inline comments. Comment at: clang-tidy/modernize/UseAutoCheck.cpp:346 -const auto *NewExpr = cast(V->getInit()->IgnoreParenImpCasts()); -// Ensure that every VarDecl has a CXXNewExpr initializer. -if (!NewExpr) +const auto *Expr = cast(V-

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

2016-10-10 Thread Aaron Ballman via cfe-commits
aaron.ballman added inline comments. Comment at: clang-tidy/modernize/UseAutoCheck.cpp:346 -const auto *NewExpr = cast(V->getInit()->IgnoreParenImpCasts()); -// Ensure that every VarDecl has a CXXNewExpr initializer. -if (!NewExpr) +const auto *Expr = cast(V->g