llvm-project/clang-tools-extra/test
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
..
Unit Replace hardcoded comment at 'lit.site.cfg.in' 2016-04-16 07:01:42 +00:00
clang-apply-replacements Handle newlines on Windows correctly. 2014-12-09 02:57:56 +00:00
clang-query Add a makefile for clang-query. Patch by Alex Horn! 2014-02-18 19:46:01 +00:00
clang-rename [clang-rename] remove obsolete tests and apply fixes to existing 2016-07-16 08:55:01 +00:00
clang-tidy clang-tidy modernize-loop-convert: preserve type of alias declaration (bug 28341) 2016-07-20 12:32:06 +00:00
include-fixer [include-fixer] A refactoring of IncludeFixerContext. 2016-07-19 14:49:04 +00:00
modularize Fixed some cases in the modularize assistant mode where header file names didn't translate to valid module names. 2016-03-21 23:05:14 +00:00
pp-trace Update to match clang r236404. 2015-05-04 03:15:55 +00:00
.clang-format Add a .clang-format to avoid reflow of test RUN lines 2013-12-01 05:08:00 +00:00
CMakeLists.txt [find-all-symbols] Add a test to make sure merging actually works. 2016-05-31 12:12:19 +00:00
lit.cfg [find-all-symbols] Add a test to make sure merging actually works. 2016-05-31 12:12:19 +00:00
lit.site.cfg.in Replace hardcoded comment at 'lit.site.cfg.in' 2016-04-16 07:01:42 +00:00