diff options
author | Mitchell Balan <mitchell@stellarscience.com> | 2019-11-19 10:57:16 -0500 |
---|---|---|
committer | Mitchell Balan <mitchell@stellarscience.com> | 2019-11-19 10:59:21 -0500 |
commit | 980653621ef563df41f1d09a1ac8c58708f79930 (patch) | |
tree | c60a9bcc6862c6937ff5595ba488e41e22c15c5e /lldb/packages/Python/lldbsuite/test/python_api/signals/main.cpp | |
parent | 39de82ecc9c2e461e1318ed9926286a1eed2be3f (diff) | |
download | bcm5719-llvm-980653621ef563df41f1d09a1ac8c58708f79930.tar.gz bcm5719-llvm-980653621ef563df41f1d09a1ac8c58708f79930.zip |
[clang-tidy] Give readability-redundant-member-init an option IgnoreBaseInCopyConstructors to avoid breaking code with gcc -Werror=extra
Summary:
readability-redundant-member-init removes redundant / unnecessary member and base class initialization. Unfortunately for the specific case of a copy constructor's initialization of a base class, gcc at strict warning levels warns if "base class is not initialized in the copy constructor of a derived class".
This patch adds an option `IgnoreBaseInCopyConstructors` defaulting to 0 (thus maintaining current behavior by default) to skip the specific case of removal of redundant base class initialization in the copy constructor. Enabling this option enables the resulting code to continue to compile successfully under `gcc -Werror=extra`. New test cases `WithCopyConstructor1` and `WithCopyConstructor2` in clang-tools-extra/test/clang-tidy/readability-redundant-member-init.cpp show that it removes redundant members even from copy constructors.
Reviewers: malcolm.parsons, alexfh, hokein, aaron.ballman, lebedev.ri
Patch by: poelmanc
Subscribers: mgehre, lebedev.ri, cfe-commits
Tags: #clang, #clang-tools-extra
Differential revision: https://reviews.llvm.org/D69145
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/python_api/signals/main.cpp')
0 files changed, 0 insertions, 0 deletions