summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/readability/RedundantMemberInitCheck.h
Commit message (Collapse)AuthorAgeFilesLines
* [clang-tidy] Give readability-redundant-member-init an option ↵Mitchell Balan2019-11-191-1/+7
| | | | | | | | | | | | | | | | | | | 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
* [clang-tidy] Switch checks to #include "ClangTidyCheck.h"Alexander Kornienko2019-03-251-1/+1
| | | | llvm-svn: 356892
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [clang-tidy] Add check 'readability-redundant-member-init'Malcolm Parsons2016-10-201-0/+36
Summary: The check emits a warning if a member-initializer calls the member's default constructor with no arguments. Reviewers: sbenza, alexfh, aaron.ballman Subscribers: modocache, mgorny, Eugene.Zelenko, etienneb, Prazek, hokein, cfe-commits, beanz Differential Revision: https://reviews.llvm.org/D24339 llvm-svn: 284742
OpenPOWER on IntegriCloud