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
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");
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");
--
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
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");
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).
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
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
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
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
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
alexfh added inline comments.
Comment at: clang-tidy/modernize/UseAutoCheck.cpp:252-254
+ anyOf(hasType(autoType()),
+hasType(pointerType(pointee(autoType(,
+hasType(referenceType(pointee(autoType())
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-
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
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
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
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
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-
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
19 matches
Mail list logo