summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/readability/RedundantMemberInitCheck.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [clang-tidy] Give readability-redundant-member-init an option ↵Mitchell Balan2019-11-191-5/+17
| | | | | | | | | | | | | | | | | | | 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
* 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] Handle anonymous structs/unions in member init checks.Malcolm Parsons2017-08-011-2/+3
| | | | | | | | | | | | Use getAnyMember() instead of getMember() to avoid crash on anonymous structs/unions. Don't warn about initializing members of an anonymous union. Fixes PR32966. Reviewed by alexfh. llvm-svn: 309668
* [clang-tidy] Make 2 checks register matchers for C++ only.Malcolm Parsons2016-12-271-0/+3
| | | | llvm-svn: 290633
* [clang-tidy] Change readability-redundant-member-init to get base type from ↵Malcolm Parsons2016-11-151-1/+1
| | | | | | | | | | | | | | constructor Summary: Fixes PR30835 Reviewers: alexfh, hokein, aaron.ballman Subscribers: Prazek, cfe-commits Differential Revision: https://reviews.llvm.org/D26118 llvm-svn: 286990
* [clang-tools-extra] Format sources with clang-format. NFC.Mandeep Singh Grang2016-11-081-1/+1
| | | | | | | | | | | | | | | | Summary: Ran clang-format on all .c/.cpp/.h files in clang-tools-extra. Excluded the test, unittests, clang-reorder-fields, include-fixer, modularize and pptrace directories. Reviewers: klimek, alexfh Subscribers: nemanjai Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D26329 llvm-svn: 286221
* [clang-tidy] Add check 'readability-redundant-member-init'Malcolm Parsons2016-10-201-0/+65
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