llvm-project/clang-tools-extra/clang-tidy/modernize
Matthias Gehre 056237a457 clang-tidy modernize-loop-convert: preserve type of alias declaration (bug 28341)
Summary:
Previoly, the added test failed with the fillowing fixit:

     char v[5];

-    for(size_t i = 0; i < 5; ++i)
+    for(char value : v)
     {
-        unsigned char value = v[i];
         if (value > 127)

i.e. the variable 'value' changes from unsigned char to signed char. And
thus the following 'if' does not work anymore.

With this commit, the fixit is changed to:
     char v[5];

-    for(size_t i = 0; i < 5; ++i)
+    for(unsigned char value : v)
     {
-        unsigned char value = v[i];
         if (value > 127)

Reviewers: alexfh, klimek

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D22069

llvm-svn: 276111
2016-07-20 12:32:06 +00:00
..
AvoidBindCheck.cpp [clang-tidy] Adds modernize-avoid-bind check 2016-05-12 20:06:04 +00:00
AvoidBindCheck.h [clang-tidy] Adds modernize-avoid-bind check 2016-05-12 20:06:04 +00:00
CMakeLists.txt [clang-tidy] Add modernize-use-using 2016-06-25 18:37:53 +00:00
DeprecatedHeadersCheck.cpp [clang-tidy] Another attempt to fix MSVC build 2016-02-25 00:39:11 +00:00
DeprecatedHeadersCheck.h [clang-tidy] Fix doxygen errors. NFC. 2016-06-17 11:43:33 +00:00
LoopConvertCheck.cpp clang-tidy modernize-loop-convert: preserve type of alias declaration (bug 28341) 2016-07-20 12:32:06 +00:00
LoopConvertCheck.h Handle correctly containers that are data members in modernize-loop-convert. 2015-11-03 16:38:31 +00:00
LoopConvertUtils.cpp Fix clang-tidy patterns to adapt to newly added ExprWithCleanups nodes. 2016-06-21 20:11:20 +00:00
LoopConvertUtils.h [clang-tidy] Remove dead code. NFC. 2016-06-15 16:51:04 +00:00
MakeSharedCheck.cpp [clang-tidy] Add modernize-make-shared check 2016-05-02 16:56:39 +00:00
MakeSharedCheck.h [clang-tidy] Add modernize-make-shared check 2016-05-02 16:56:39 +00:00
MakeSmartPtrCheck.cpp [ASTMatchers] Added ignoringParenImpCasts to has matchers 2016-05-31 15:26:56 +00:00
MakeSmartPtrCheck.h [Clang-tidy] Fix Clang-tidy modernize-use-override and some Include What You Use warnings in modernize/MakeSmartPtrCheck.h. 2016-05-03 01:13:27 +00:00
MakeUniqueCheck.cpp [clang-tidy] Add modernize-make-shared check 2016-05-02 16:56:39 +00:00
MakeUniqueCheck.h [clang-tidy] Add modernize-make-shared check 2016-05-02 16:56:39 +00:00
ModernizeTidyModule.cpp [clang-tidy] Add modernize-use-using 2016-06-25 18:37:53 +00:00
PassByValueCheck.cpp [ASTMatchers] Added ignoringParenImpCasts to has matchers 2016-05-31 15:26:56 +00:00
PassByValueCheck.h [clang-tidy] Cleanup namespace in utils folder. 2016-05-03 02:54:05 +00:00
RawStringLiteralCheck.cpp [Clang-tidy] Fix for crash in modernize-raw-string-literal check 2016-04-21 14:39:12 +00:00
RawStringLiteralCheck.h [clang-tidy] Cleaning namespaces to be more consistant across checkers. 2016-05-02 18:00:29 +00:00
RedundantVoidArgCheck.cpp [clang-tidy] Cleaning namespaces to be more consistant across checkers. 2016-05-02 18:00:29 +00:00
RedundantVoidArgCheck.h Add support for type aliases to modernize-redundant-void-arg.cpp 2016-04-14 19:28:13 +00:00
ReplaceAutoPtrCheck.cpp [clang-tidy] Cleanup namespace in utils folder. 2016-05-03 02:54:05 +00:00
ReplaceAutoPtrCheck.h [clang-tidy] Cleanup namespace in utils folder. 2016-05-03 02:54:05 +00:00
ShrinkToFitCheck.cpp [ASTMatchers] Added ignoringParenImpCasts to has matchers 2016-05-31 15:26:56 +00:00
ShrinkToFitCheck.h [clang-tidy] Move misc-use-override and readability-shrink-to-fit to "modernize/" 2015-08-31 13:17:43 +00:00
UseAutoCheck.cpp Fix clang-tidy patterns to adapt to newly added ExprWithCleanups nodes. 2016-06-21 20:11:20 +00:00
UseAutoCheck.h [clang-tidy] modernize-use-auto: don't remove stars by default 2016-06-03 21:22:58 +00:00
UseBoolLiteralsCheck.cpp [ASTMatchers] Added ignoringParenImpCasts to has matchers 2016-05-31 15:26:56 +00:00
UseBoolLiteralsCheck.h [clang-tidy] Adds modernize-use-bool-literals check. 2016-05-11 11:33:16 +00:00
UseDefaultCheck.cpp [ASTMatchers] Added ignoringParenImpCasts to has matchers 2016-05-31 15:26:56 +00:00
UseDefaultCheck.h Add modernize-use-default check to clang-tidy. 2015-10-21 12:58:15 +00:00
UseEmplaceCheck.cpp [clang-tidy] Add modernize-use-emplace 2016-06-21 15:23:27 +00:00
UseEmplaceCheck.h [clang-tidy] Add modernize-use-emplace 2016-06-21 15:23:27 +00:00
UseNullptrCheck.cpp [clang-tidy] Lift common matchers to utils namespace 2016-05-17 19:36:09 +00:00
UseNullptrCheck.h [clang-tidy] Fix use-after-free in UseNullptrCheck. 2015-08-19 23:57:34 +00:00
UseOverrideCheck.cpp [clang-tidy] fix a couple of modernize-use-override bugs 2016-04-04 14:31:36 +00:00
UseOverrideCheck.h [clang-tidy] Move misc-use-override and readability-shrink-to-fit to "modernize/" 2015-08-31 13:17:43 +00:00
UseUsingCheck.cpp [clang-tidy] Add modernize-use-using 2016-06-25 18:37:53 +00:00
UseUsingCheck.h [clang-tidy] Add modernize-use-using 2016-06-25 18:37:53 +00:00