[PATCH] D45927: [clang-tidy] [modernize-use-auto] Correct way to calculate a type name length for multi-token types

2018-06-15 Thread Zinovy Nis via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE334829: [clang-tidy] This patch is a fix for D45405 where spaces were mistakenly… (authored by zinovy.nis, committed by ). Changed prior to commit:

[PATCH] D45927: [clang-tidy] [modernize-use-auto] Correct way to calculate a type name length for multi-token types

2018-06-06 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. LG https://reviews.llvm.org/D45927 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D45927: [clang-tidy] [modernize-use-auto] Correct way to calculate a type name length for multi-token types

2018-05-18 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis marked an inline comment as done. zinovy.nis added a comment. Alexander, can you please have a look at the latest patch? Thanks. https://reviews.llvm.org/D45927 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D45927: [clang-tidy] [modernize-use-auto] Correct way to calculate a type name length for multi-token types

2018-05-16 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis marked an inline comment as done. zinovy.nis added inline comments. Comment at: modernize/UseAutoCheck.cpp:40 +? Alpha +: (std::isspace(C) || (!RemoveStars && C == '*')) ? Space + :

[PATCH] D45927: [clang-tidy] [modernize-use-auto] Correct way to calculate a type name length for multi-token types

2018-05-14 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis updated this revision to Diff 146677. zinovy.nis added a comment. - Fix for templated type names. Thanks AlexanderK for pointing. https://reviews.llvm.org/D45927 Files: clang-tidy/modernize/UseAutoCheck.cpp docs/clang-tidy/checks/modernize-use-auto.rst

[PATCH] D45927: [clang-tidy] [modernize-use-auto] Correct way to calculate a type name length for multi-token types

2018-05-09 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/modernize-use-auto-min-type-name-length.cpp:61-83 +long int li = static_cast(foo()); +// CHECK-FIXES-0-0: auto li = {{.*}} +// CHECK-FIXES-0-5: auto li = {{.*}} +// CHECK-FIXES-1-0: auto li = {{.*}} +//

[PATCH] D45927: [clang-tidy] [modernize-use-auto] Correct way to calculate a type name length for multi-token types

2018-05-06 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added inline comments. Comment at: modernize/UseAutoCheck.cpp:40 +? Alpha +: (std::isspace(C) || (!RemoveStars && C == '*')) ? Space + : Punctuation; `isspace` here is

[PATCH] D45927: [clang-tidy] [modernize-use-auto] Correct way to calculate a type name length for multi-token types

2018-05-06 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added inline comments. Comment at: clang-tidy/modernize-use-auto-min-type-name-length.cpp:61-83 +long int li = static_cast(foo()); +// CHECK-FIXES-0-0: auto li = {{.*}} +// CHECK-FIXES-0-5: auto li = {{.*}} +// CHECK-FIXES-1-0: auto li = {{.*}} +

[PATCH] D45927: [clang-tidy] [modernize-use-auto] Correct way to calculate a type name length for multi-token types

2018-05-06 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added inline comments. Comment at: clang-tidy/modernize-use-auto-min-type-name-length.cpp:61-83 +long int li = static_cast(foo()); +// CHECK-FIXES-0-0: auto li = {{.*}} +// CHECK-FIXES-0-5: auto li = {{.*}} +// CHECK-FIXES-1-0: auto li = {{.*}} +

[PATCH] D45927: [clang-tidy] [modernize-use-auto] Correct way to calculate a type name length for multi-token types

2018-05-05 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added inline comments. Comment at: clang-tidy/modernize-use-auto-min-type-name-length.cpp:61-83 +long int li = static_cast(foo()); +// CHECK-FIXES-0-0: auto li = {{.*}} +// CHECK-FIXES-0-5: auto li = {{.*}} +// CHECK-FIXES-1-0: auto li = {{.*}} +

[PATCH] D45927: [clang-tidy] [modernize-use-auto] Correct way to calculate a type name length for multi-token types

2018-05-03 Thread Alexander Kornienko via Phabricator 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-use-auto-min-type-name-length.cpp:61-83 +long int li = static_cast(foo()); +// CHECK-FIXES-0-0: auto li = {{.*}} +

[PATCH] D45927: [clang-tidy] [modernize-use-auto] Correct way to calculate a type name length for multi-token types

2018-05-01 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis updated this revision to Diff 144727. zinovy.nis added a comment. - Applied Alexander's changes. https://reviews.llvm.org/D45927 Files: clang-tidy/checks/modernize-use-auto.rst clang-tidy/modernize-use-auto-min-type-name-length.cpp modernize/UseAutoCheck.cpp Index:

[PATCH] D45927: [clang-tidy] [modernize-use-auto] Correct way to calculate a type name length for multi-token types

2018-04-30 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. In https://reviews.llvm.org/D45927#1083051, @zinovy.nis wrote: > > I think, it's 13, if you choose to remove stars, and 17 otherwise. The > > difference is excessive spaces vs. required ones. Implementing proper logic > > may be involved, but we can simplify it to

[PATCH] D45927: [clang-tidy] [modernize-use-auto] Correct way to calculate a type name length for multi-token types

2018-04-30 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added a comment. > I think, it's 13, if you choose to remove stars, and 17 otherwise. The > difference is excessive spaces vs. required ones. Implementing proper logic > may be involved, but we can simplify it to something like "count all > non-space characters and a single space

[PATCH] D45927: [clang-tidy] [modernize-use-auto] Correct way to calculate a type name length for multi-token types

2018-04-30 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. Actually, just ignoring spaces may be not the best option. In https://reviews.llvm.org/D45927#1074593, @zinovy.nis wrote: > > I think spaces that will be removed should be counted - long long is 9. > > I thought about it, but what about "long long int

[PATCH] D45927: [clang-tidy] [modernize-use-auto] Correct way to calculate a type name length for multi-token types

2018-04-30 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added inline comments. Comment at: clang-tidy/modernize/UseAutoCheck.cpp:33 + +bool IsNotSpace(const char& C) { + return !std::isspace(static_cast(C)); alexfh wrote: > Why `const char&` and not just `char`? Moreover, these two functions can be >

[PATCH] D45927: [clang-tidy] [modernize-use-auto] Correct way to calculate a type name length for multi-token types

2018-04-30 Thread Alexander Kornienko via Phabricator 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:33 + +bool IsNotSpace(const char& C) { + return !std::isspace(static_cast(C)); Why `const

[PATCH] D45927: [clang-tidy] [modernize-use-auto] Correct way to calculate a type name length for multi-token types

2018-04-30 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added a comment. Gentle ping. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D45927 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D45927: [clang-tidy] [modernize-use-auto] Correct way to calculate a type name length for multi-token types

2018-04-22 Thread Zinovy Nis via cfe-commits
> I think spaces that will be removed should be counted - long long is 9. I thought about it, but what about "long long int ** * *"? Is it still 9? I think it's a business of clang-format to remove excessive spaces, not of clang-tidy. вс, 22 апр. 2018 г. в

[PATCH] D45927: [clang-tidy] [modernize-use-auto] Correct way to calculate a type name length for multi-token types

2018-04-22 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added a subscriber: malcolm.parsons. zinovy.nis added a comment. > I think spaces that will be removed should be counted - long long is 9. I thought about it, but what about "long long int - * * *"? Is it still 9? I think it's a business of clang-format to

[PATCH] D45927: [clang-tidy] [modernize-use-auto] Correct way to calculate a type name length for multi-token types

2018-04-22 Thread Malcolm Parsons via Phabricator via cfe-commits
malcolm.parsons added a comment. I think spaces that will be removed should be counted - long long is 9. OTOH, MinTypeNameLength isn't likely to be set high enough for that to matter. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D45927

[PATCH] D45927: [clang-tidy] [modernize-use-auto] Correct way to calculate a type name length for multi-token types

2018-04-22 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis created this revision. zinovy.nis added reviewers: malcolm.parsons, alexfh. zinovy.nis added a project: clang-tools-extra. Herald added subscribers: cfe-commits, xazax.hun. This patch is a fix for https://reviews.llvm.org/D45405 where spaces were also considered as a part of a type