[clang-tidy] New check cppcoreguidelines-prefer-member-initializer
authorAdam Balogh <adam.balogh@ericsson.com>
Fri, 11 Sep 2020 08:12:39 +0000 (10:12 +0200)
committerAdam Balogh <adam.balogh@ericsson.com>
Mon, 21 Sep 2020 12:42:58 +0000 (14:42 +0200)
commit4fc0214a10140fa77449677e8094ea22d3d17701
treece8e473c1338614bce1d23a09cddd22d53f733a6
parentf3fa954b5b19acdd4b95ff2ca1ff4f74f4b6b21b
[clang-tidy] New check cppcoreguidelines-prefer-member-initializer

Finds member initializations in the constructor body which can be placed
into the initialization list instead. This does not only improves the
readability of the code but also affects positively its performance.
Class-member assignments inside a control statement or following the
first control statement are ignored.

Differential Revision: https://reviews.llvm.org/D71199
clang-tools-extra/clang-tidy/cppcoreguidelines/CMakeLists.txt
clang-tools-extra/clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp
clang-tools-extra/clang-tidy/cppcoreguidelines/PreferMemberInitializerCheck.cpp [new file with mode: 0644]
clang-tools-extra/clang-tidy/cppcoreguidelines/PreferMemberInitializerCheck.h [new file with mode: 0644]
clang-tools-extra/docs/ReleaseNotes.rst
clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-prefer-member-initializer.rst [new file with mode: 0644]
clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-prefer-member-initializer-modernize-use-default-member-init-assignment.cpp [new file with mode: 0644]
clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-prefer-member-initializer-modernize-use-default-member-init.cpp [new file with mode: 0644]
clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-prefer-member-initializer.cpp [new file with mode: 0644]