This revision was automatically updated to reflect the committed changes.
Closed by commit rL289797: [clang-tidy] Enhance modernize-use-auto to templated
function casts (authored by malcolm.parsons).
Changed prior to commit:
https://reviews.llvm.org/D27166?vs=81540=81554#toc
Repository:
rL
malcolm.parsons updated this revision to Diff 81540.
malcolm.parsons added a comment.
Add FIXME comment.
https://reviews.llvm.org/D27166
Files:
clang-tidy/modernize/UseAutoCheck.cpp
docs/ReleaseNotes.rst
docs/clang-tidy/checks/modernize-use-auto.rst
Prazek accepted this revision.
Prazek added a comment.
This revision is now accepted and ready to land.
LGTM, thanks for all the fixes.
Can you leave FIXIT comment somewhere in the code near the FixitHint about the
function pointers?
https://reviews.llvm.org/D27166
malcolm.parsons updated this revision to Diff 81465.
malcolm.parsons added a comment.
Add tests for implicit vars and pointers to pointers to auto.
https://reviews.llvm.org/D27166
Files:
clang-tidy/modernize/UseAutoCheck.cpp
docs/ReleaseNotes.rst
malcolm.parsons added a comment.
In https://reviews.llvm.org/D27166#622127, @Prazek wrote:
> In https://reviews.llvm.org/D27166#622108, @malcolm.parsons wrote:
>
> > In https://reviews.llvm.org/D27166#622103, @Prazek wrote:
> >
> > > There is also problem with function pointers
> >
> >
> > The
Prazek added a comment.
In https://reviews.llvm.org/D27166#622108, @malcolm.parsons wrote:
> In https://reviews.llvm.org/D27166#622103, @Prazek wrote:
>
> > There is still one more problem:
> >
> > /home/prazek/llvm/lib/Analysis/ScalarEvolution.cpp:2442:11: warning: use
> > auto when
malcolm.parsons updated this revision to Diff 81377.
malcolm.parsons added a comment.
Use qualType(hasDescendant(autoType())) to fix skipping of declarations that
are already using auto.
https://reviews.llvm.org/D27166
Files:
clang-tidy/modernize/UseAutoCheck.cpp
docs/ReleaseNotes.rst
malcolm.parsons added a comment.
In https://reviews.llvm.org/D27166#622103, @Prazek wrote:
> There is still one more problem:
>
> /home/prazek/llvm/lib/Analysis/ScalarEvolution.cpp:2442:11: warning: use
> auto when initializing with a template cast to avoid duplicating the type
> name
Prazek added a comment.
There is still one more problem:
/home/prazek/llvm/lib/Analysis/ScalarEvolution.cpp:2442:11: warning: use auto
when initializing with a template cast to avoid duplicating the type name
[modernize-use-auto]
const auto **O = SCEVAllocator.Allocate(Ops.size());
malcolm.parsons updated this revision to Diff 81375.
malcolm.parsons added a comment.
Ignore implicit VarDecls
https://reviews.llvm.org/D27166
Files:
clang-tidy/modernize/UseAutoCheck.cpp
docs/ReleaseNotes.rst
docs/clang-tidy/checks/modernize-use-auto.rst
malcolm.parsons added a comment.
In https://reviews.llvm.org/D27166#622072, @Prazek wrote:
> Have you run this check on LLVM & Clang to check if it works?
I ran it on some of clang-tools-extra:
unittests/clang-tidy/ClangTidyDiagnosticConsumerTest.cpp:17
-const VarDecl *Var =
Prazek added a comment.
Cool!
Have you run this check on LLVM & Clang to check if it works?
I just runned it and I got this weird behavior
lib/Analysis/AssumptionCache.cpp:120
-for (const BasicBlock : cast(*I.first))
+for (const BasicBlock : auto(*I.first))
malcolm.parsons updated this revision to Diff 81300.
malcolm.parsons added a comment.
Split up matcher.
Add tests.
Improve doc.
https://reviews.llvm.org/D27166
Files:
clang-tidy/modernize/UseAutoCheck.cpp
docs/ReleaseNotes.rst
docs/clang-tidy/checks/modernize-use-auto.rst
malcolm.parsons added inline comments.
Comment at: clang-tidy/modernize/UseAutoCheck.cpp:173-177
+/// Matches the type that was substituted for the template parameter.
+AST_MATCHER_P(SubstTemplateTypeParmType, hasReplacementType,
+ ast_matchers::internal::Matcher,
Prazek added a comment.
In https://reviews.llvm.org/D27166#617696, @malcolm.parsons wrote:
> In https://reviews.llvm.org/D27166#617621, @Prazek wrote:.
>
> > Does it work for cases like?
>
>
> Yes; `replaceExpr()` checks that the variable has the same unqualified type
> as the initializer and
malcolm.parsons added a comment.
In https://reviews.llvm.org/D27166#617621, @Prazek wrote:.
> Does it work for cases like?
Yes; `replaceExpr()` checks that the variable has the same unqualified type as
the initializer and the same canonical type as other variables in the
declaration.
Prazek added a reviewer: staronj.
Prazek added a comment.
gosh, I found it too late. Jakub started to work on the same problem and he
have made initial check for it.
One of the problems he got was multideclarations.
Does it work for cases like?
long a = lexical_cast(z), b = lexical_cast(y);
malcolm.parsons updated this revision to Diff 80623.
malcolm.parsons added a comment.
Remove hasReplacementType matcher.
https://reviews.llvm.org/D27166
Files:
clang-tidy/modernize/UseAutoCheck.cpp
docs/ReleaseNotes.rst
docs/clang-tidy/checks/modernize-use-auto.rst
malcolm.parsons added a comment.
ping.
https://reviews.llvm.org/D27166
___
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 79632.
malcolm.parsons added a comment.
Add to release notes
https://reviews.llvm.org/D27166
Files:
clang-tidy/modernize/UseAutoCheck.cpp
docs/ReleaseNotes.rst
docs/clang-tidy/checks/modernize-use-auto.rst
Eugene.Zelenko added a comment.
In https://reviews.llvm.org/D27166#608339, @malcolm.parsons wrote:
> In https://reviews.llvm.org/D27166#606772, @Eugene.Zelenko wrote:
>
> > It'll be worth to mention enhancement in Release Notes.
>
>
> They already say this:
>
> - The `modernize-use-auto
>
malcolm.parsons marked an inline comment as done.
malcolm.parsons added a comment.
In https://reviews.llvm.org/D27166#606772, @Eugene.Zelenko wrote:
> It'll be worth to mention enhancement in Release Notes.
They already say this:
- The `modernize-use-auto
malcolm.parsons updated this revision to Diff 79627.
malcolm.parsons added a comment.
Handle templated member functions too.
https://reviews.llvm.org/D27166
Files:
clang-tidy/modernize/UseAutoCheck.cpp
docs/clang-tidy/checks/modernize-use-auto.rst
alexfh added inline comments.
Comment at: clang-tidy/modernize/UseAutoCheck.cpp:173-177
+/// Matches the type that was substituted for the template parameter.
+AST_MATCHER_P(SubstTemplateTypeParmType, hasReplacementType,
+ ast_matchers::internal::Matcher,
Eugene.Zelenko added a comment.
It'll be worth to mention enhancement in Release Notes.
https://reviews.llvm.org/D27166
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
malcolm.parsons created this revision.
malcolm.parsons added reviewers: aaron.ballman, Prazek, alexfh.
malcolm.parsons added a subscriber: cfe-commits.
Herald added a subscriber: JDevlieghere.
Use auto when declaring variables that are initialized by calling a templated
function that returns its
26 matches
Mail list logo