Move code shared between UnnecessaryCopyInitialization and ForRangeCopyCheck into utilities files.
Add more test cases for UnnecessaryCopyInitialization and disable fixes inside of macros.
Details
Diff Detail
Event Timeline
clang-tidy/performance/UnnecessaryCopyInitialization.cpp | ||
---|---|---|
69 | nit: Clang-format doesn't reflow string literals | |
clang-tidy/performance/UnnecessaryCopyInitialization.h | ||
18–19 | Maybe just "The check detects local variable declarations ...."? Also, should the .rst file be updated as well? | |
clang-tidy/utils/DeclRefExprUtils.h | ||
22 | nit: There should be an empty line after the brief summary, IIRC. (But you can look at the doxygen output and see how this looks like.) | |
clang-tidy/utils/FixItHintUtils.cpp | ||
24 | Lexer::getLocForEndOfToken seems to be more suitable for this purpose. | |
clang-tidy/utils/FixItHintUtils.h | ||
22 | Since this is now a library, we should make names clear and unambiguous. I'd pull a part of the name's meaning to the namespace and expand the name with the needed details. Maybe something like this: namespace clang { namespace tidy { namespace utils { namespace create_fixit { FixItHint changeVarDeclToReference(...); FixItHint changeVarDeclToConst(...); |
clang-tidy/utils/FixItHintUtils.cpp | ||
---|---|---|
2 | Please fix the line break. |
Maybe just "The check detects local variable declarations ...."?
Also, should the .rst file be updated as well?