llvm-project/clang-tools-extra/clang-tidy
Angel Garcia Gomez 432ff5e205 Handle correctly containers that are data members in modernize-loop-convert.
Summary:
I recently found that the variable naming wasn't working as expected with containers that are data members. The new index always received the name "Elem" (or equivalent) regardless of the container's name.
The check was assuming that the container's declaration was a VarDecl, which cannot be converted to a FieldDecl (a data member), and then it could never retrieve its name.

This also fixes some cases where the check failed to find the container at all (so it didn't do any fix) because of the same reason.

Reviewers: klimek

Subscribers: cfe-commits, alexfh

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

llvm-svn: 251943
2015-11-03 16:38:31 +00:00
..
cert Exposing an existing checker under the name cert-err61-cpp, as it corresponds to the CERT C++ secure coding rule: https://www.securecoding.cert.org/confluence/display/cplusplus/ERR61-CPP.+Catch+exceptions+by+lvalue+reference 2015-10-13 20:42:41 +00:00
cppcoreguidelines [clang-tidy] Add new check cppcoreguidelines-pro-bounds-array-to-pointer-decay 2015-10-26 21:56:02 +00:00
google Refactors AST matching code to use the new AST matcher names. This patch correlates to r247885 which performs the AST matcher rename in Clang. 2015-09-17 13:31:25 +00:00
llvm [clang-tidy] Fix llvm-include-order check on Windows. 2015-09-04 15:46:51 +00:00
misc Make a bunch of static arrays const. 2015-10-18 05:14:41 +00:00
modernize Handle correctly containers that are data members in modernize-loop-convert. 2015-11-03 16:38:31 +00:00
readability Drop dead return after llvm_unreachable. NFC. 2015-10-26 09:57:00 +00:00
tool Add a new module for the C++ Core Guidelines, and the first checker for those guidelines: cppcoreguidelines-pro-type-reinterpret-cast. 2015-10-06 13:31:00 +00:00
utils Make isExpensiveToCopy() tri-state. 2015-10-23 10:00:50 +00:00
CMakeLists.txt Add a new module for the C++ Core Guidelines, and the first checker for those guidelines: cppcoreguidelines-pro-type-reinterpret-cast. 2015-10-06 13:31:00 +00:00
ClangTidy.cpp Make a bunch of static arrays const. 2015-10-18 05:14:41 +00:00
ClangTidy.h Reapplying r246209, which exposed language options to the checkers. This time disable UseNullptrCheck when not compiling in C++ mode, but still allow in C++11 mode since it's likely the user wishes to modernize their code. 2015-08-28 13:20:46 +00:00
ClangTidyDiagnosticConsumer.cpp Replacements in different files do not overlap. 2015-10-16 16:15:27 +00:00
ClangTidyDiagnosticConsumer.h Fix overlapping replacements in clang-tidy. 2015-10-16 11:43:49 +00:00
ClangTidyModule.cpp [clang-tidy] Default options in modules. 2014-10-16 11:27:57 +00:00
ClangTidyModule.h Revert "Apply modernize-use-default to clang-tools-extra." 2015-10-20 21:45:52 +00:00
ClangTidyModuleRegistry.h [clang-tidy] Fixed header guards using clang-tidy llvm-header-guard check. NFC. 2015-03-09 16:52:33 +00:00
ClangTidyOptions.cpp [clang-tidy] Don't ignore default set of checks when a config file is found. 2015-02-05 14:50:17 +00:00
ClangTidyOptions.h Revert "Apply modernize-use-default to clang-tools-extra." 2015-10-20 21:45:52 +00:00
Makefile Add a new module for the C++ Core Guidelines, and the first checker for those guidelines: cppcoreguidelines-pro-type-reinterpret-cast. 2015-10-06 13:31:00 +00:00
add_new_check.py clang-tidy/add_new_check.py: Adapt to use %check_clang_tidy in tests 2015-10-26 21:48:08 +00:00
rename_check.py [clang-tidy] Python script for easy check rename 2015-10-11 07:58:34 +00:00