[clang-tidy] New check readability-prefer-member-initializer
authorAdam Balogh <adam.balogh@ericsson.com>
Thu, 12 Dec 2019 16:03:16 +0000 (17:03 +0100)
committerAdam Balogh <adam.balogh@ericsson.com>
Mon, 31 Aug 2020 13:59:29 +0000 (15:59 +0200)
commitf5fd7486d6c0debb465de3e927fcc31884874280
treea17779c16cc06fdb86310fc19c1037e4b3b315e4
parent1c9a09f42e5ed66cba04700f9272ff53ea3cca86
[clang-tidy] New check readability-prefer-member-initializer

Finds member initializations in the constructor body which can
be placed to the member initializers of the constructor 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/docs/clang-tidy/checks/list.rst
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]