Refactoring tools
In this section, we present many other tools that perform code analysis and source-to-source transformations by leveraging Clang's parsing abilities. You should feel comfortable to use them in a way that is similar to that of clang-tidy, relying on your commands' database to simplify their usage.
Clang Modernizer
The Clang Modernizer is a revolutionary standalone tool that aids the user in adapting old C++ code to use the newest standards, for example, C++11. It reaches this goal by performing the following transformations:
Loop convert transform: This converts older C-style
for(;;)
loops to the newer range-based loop of the formfor(auto &...:..)
Use-nullptr transform: This converts older C-style usage of
NULL
or0
constants to represent a null pointer to use the newernullptr
C++11 keywordUse-auto transform: This converts some type declarations to use the
auto
keyword in specific cases, which improves code readabilityAdd-override transform: This adds the
override...